Code Comments
Programming Forum and web based access to our favorite programming groups.When I write new record with INSERT INTO i need to get ID (Autonumber, key of this table) from this, just written record. How to do that in ASP.NET (VB or C#) and SQL Server? Thanks
Post Follow-up to this messageHow are you doing the INSERTs? Basically, you just want to look at SCOPE_IDENTITY() immediately after the INSERT; you could SELECT it, you could RETURN it, or you could SET it into an OUT variable (I favor the latter). In older versions of SQL-Server, @@IDENTITY is a fallback, but suffers with triggers. Marc
Post Follow-up to this messageselect @@identity or select scope_identity() "Marko" <marko_a@hotmail.com> wrote in message news:fua46k$8qd$1@sunce.iskon.hr... > When I write new record with INSERT INTO i need to get ID (Autonumber, key > of this table) from this, just written record. How to do that in ASP.NET > (VB or C#) and SQL Server? > > Thanks >
Post Follow-up to this message
Show a Printable Version
Email This Page to Someone!
Receive updates to this thread
Powered by vBulletin
Copyright 2000-2006 Jelsoft Enterprises Limited.