Inserting a row to a table
Database
2
Posts
2
Posters
0
Views
1
Watching
-
I use C# to Insert values into tables. Now, I have a table that has a automatic counter as the ID. Is there away that after I make insert I will get the ID of the row ? or do I have to make another pass using select ?
clint1982 wrote:
Is there away that after I make insert I will get the ID of the row ?
INSERT ....
SELECT SCOPE_IDENTITY() AS Id
Scottish Developers events: * .NET debugging, tracing and instrumentation by Duncan Edwards Jones and Code Coverage in .NET by Craig Murphy * Developer Day Scotland: are you interested in speaking or attending? My: Website | Blog