Parameter out of range error

S

STom

I have an update stored procedure that updates a table field that has a
precision of 18, scale of 15. In my stored proc, I have:

@decAccountsReceivable decimal (18,15) -- as the input parameter

In my code I am doing:
.Parameters.Add(New SqlParameter("@decAccountsReceivable ",
SqlDbType.Decimal))
.Parameters("@decAccountsReceivable ").Direction =
ParameterDirection.Input
.Parameters("@decAccountsReceivable ").Precision = 18
.Parameters("@decAccountsReceivable ").Scale = 15
.Parameters("@decAccountsReceivable ").SourceColumn =
"AccountsReceivable "
.Parameters("@decAccountsReceivable ").SourceVersion =
DataRowVersion.Current

So, if I have a number like:
66,298,000.000000000000000

I get ;'Parameter value '63298000.000000000000000' is out of range."

What gives with this? I have 15 zeros, how can it be out of range?

Thanks.

STom
 
S

STom

I forgot to mention, if I don't put the precision and scale in the vb.net
code for the parameter, I get the error:

Error converting data type numeric to decimal

Stom
 
S

STom

Duh....looks like I need to go back to school to learn more about SQL. I had
the precision set too low.

lw
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top