October 4, 2006 at 4:21 am
How can I create a unique ID or number for each record that is saved using a Stored Procedure? I need this for editing purposes
Many thanks in advance
October 4, 2006 at 10:23 am
Not sure where you are using this field... If it is within the table itself, look up IDENTITY in BOL. If it is part of the processing, you can either use this same structure in a #TempTable or @TableVariable, or do the painstaking process of incrementing each value...
I wasn't born stupid - I had to study.
October 5, 2006 at 1:57 am
thanks for pointing me in the right direction
October 5, 2006 at 8:46 am
I'm not sure why you don't create an identity column, (type Int or BigInt), in the table that you're storing the records to. That way you don't need any code, Sql does it for you, all you need to do is insert the data.
October 5, 2006 at 8:54 am
it's for editing purposes, I'd be using update on the record and as I won't know which field I'd be updating it'll be difficult keeping track of which field I'd be working on, the id would be a great help, thanks Dan
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply