Precision is invalid

  • Hi,

    I keep getting this error when executing a command object:

    Microsoft OLE DB Provider for SQL Server (0x80004005)

    The precision is invalid.

    My table fields are defined as:

    Quantity numeric precision=7 scale=2

    Discount numeric precision=5 scale=2

    My command object on the asp page is:

    .Parameters.Append .CreateParameter("@Quantity",adNumeric,adParamInput,0,request.form("txtQuantity"))

    .Parameters.Append .CreateParameter("@Discount",adNumeric,adParamInput,0,request.Form("txtDiscount"))

    My proc is defined as:

    @Quantity numeric(7,2) = 0,

    @discount numeric(5,2) = 0,

    Anybody got any ideas?

    Thanks

    Tim

  • Please don't crosspost. That said, ensure you are setting the precision and numericscale of your ADO parameters:

    
    
    With oCmd
    .Parameters.Append .CreateParameter("@Qty", adDecimal, adParamInput, , dblQty)
    .Parameters("@Qty").Precision = 9
    .Parameters("@Qty").NumericScale = 2
    End With
  • Oops, sorry about crosspost.

    Thanks for the help, I just figured it out also.

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply