>The best way to generate automatic primary key values is to use auto-increment integer key fields. You can get ID value using "SELECT @@IDENTITY" query to SQL Server.
I wouldn't say thats the best way, what if your INSERT triggers another INSERT somewhere else? Now the @@IDENTITY will be the key of another table, not the one you expected.
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only