Getting the Identity from a newly inserted record

Posts   
 
    
Gero
User
Posts: 3
Joined: 06-Apr-2006
# Posted on: 06-Apr-2006 16:16:33   

Hi all,

I am new to LLBGen Pro, i just bought it about 2 days ago, i think its amazing, it is already saving me so much work i cant beleive it!!

Anyways my question is, how can i get the identity (@@IDENTITY) of a newly inserted record, I know how to do it with stored procs, and I am guessing that i could use the call stored proceadure commands, but i am just wondering if i can do it any other way.

I am using self servicing - SQL Server 2000 and VS studio 2005.

Thanks

Jason.

PS Sorry I wasnt sure what forum to post this in.

Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
# Posted on: 06-Apr-2006 16:30:10   

The PK of the entity you are saving is always set after the save operation.