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

  • Fixed it myself. I forgot to add this to my command object:

    .Parameters("@Quantity").Precision = 7

    .Parameters("@Quantity").NumericScale = 2

    .Parameters("@Discount").Precision = 5

    .Parameters("@Discount").NumericScale = 2

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

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