Re: Getting the value that was generated using the IDENTITY property
From: Aaron Bertrand - MVP (aaron_at_TRASHaspfaq.com)
Date: 05/04/04
- Next message: Aaron Bertrand - MVP: "Re: Count issues"
- Previous message: Kostas: "Row size - Not so Important"
- Maybe in reply to: Novice: "Getting the value that was generated using the IDENTITY property"
- Messages sorted by: [ date ] [ thread ]
Date: Tue, 4 May 2004 11:28:23 -0400
???
-- Aaron Bertrand SQL Server MVP http://www.aspfaq.com/ <y_tyagi79@yahoo.com> wrote in message news:upSr9qeMEHA.2704@TK2MSFTNGP10.phx.gbl... > Hi, > > Yes Anith is very much correct but remember to use left(Date_Col, 12) = > @DateVal in where clause of queries in stored procedure. > > Best Regards > Yogesh > > "Aaron Bertrand - MVP" <aaron@TRASHaspfaq.com> wrote in message > news:uo4RKpeMEHA.3348@TK2MSFTNGP09.phx.gbl... > > > You can use @@IDENTITY system variable which variable which will be > > > populated with the last identity value always. > > > > Actually, the reason I suggested SCOPE_IDENTITY as opposed to @@IDENTITY > is > > that @@IDENTITY can be tampered with between the INSERT and the retrieval > of > > the value, e.g. if the table has a trigger that in turn causes a separate > > @@IDENTITY to be generated. SCOPE_IDENTITY() is immune to this side > effect. > > > > A > > > > > >
- Next message: Aaron Bertrand - MVP: "Re: Count issues"
- Previous message: Kostas: "Row size - Not so Important"
- Maybe in reply to: Novice: "Getting the value that was generated using the IDENTITY property"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|
Loading