Stored procedure need to do this.

  • I am trying to write a stored procedure where i select a bacodeNo field from a table then convert the barcode to numeric (from Varchar).if i get an error in converting it is because their was an error when scanned(non nUmeric Characters) or it wasnot sacanned and i want to output the record id to an error table. if it succeeds in the conversion i want to strip out the last two digits and save them and the third last digit and save, that is if their is 16 digits in the barcode otherwise another error into the error table.

    Can anyone help with examples.

  • See the isnumeric, right, left and len functions in BOL to achieve this.

    Regards,

    Andy Jones

    andyj93@hotmail.com

    .

  • I did notknow there was a Isnumeric function,Nothing in my sql 6.5 unleashed book." i read in books online it seems it will work but i donot know how to use it.

    what i need for a trigger is.

    if inserted.barcode is a numeric then i will us in string to save what i need.

    if it is not numeric i want to insert the inserted.ID and an error msg into error table.

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

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