Why aren't you setting the Primary key for the row and letting SQL server handle that? You should write a stored procedure to write the data, and if you need to get back the ID of the row that you just inserted, you can return the value of the SCOPE_IDENTITY() command.
alc6379
Cookie... That's it
2,821 posts since Dec 2003
Reputation Points: 186
Solved Threads: 149
Skill Endorsements: 3
Yes @@identity will give you the the New id after insert
Pgmer
Practically a Posting Shark
881 posts since Apr 2008
Reputation Points: 60
Solved Threads: 158
Skill Endorsements: 1
Question Answered as of 2 Years Ago by
jlego,
Unhnd_Exception,
alc6379
and 1 other