what is @identity in sql server 2005
-
what is @identity in sql server 2005............is a table or variable what functionality it has...plz explain.
-
what is @identity in sql server 2005............is a table or variable what functionality it has...plz explain.
I think you mean @@identity example
INSERT INTO Production.Location (Name, CostRate, Availability, ModifiedDate) VALUES ('Damaged Goods', 5, 2.5, GETDATE()); GO SELECT @@IDENTITY AS 'Identity';
This gets the last Identity field inserted into a talbe, ie usually the primary key.DEVELOPER DAY SCOTLAND 2009 Watch this space http://www.developerdayscotland.com/[^]
-
I think you mean @@identity example
INSERT INTO Production.Location (Name, CostRate, Availability, ModifiedDate) VALUES ('Damaged Goods', 5, 2.5, GETDATE()); GO SELECT @@IDENTITY AS 'Identity';
This gets the last Identity field inserted into a talbe, ie usually the primary key.DEVELOPER DAY SCOTLAND 2009 Watch this space http://www.developerdayscotland.com/[^]
yes sure....that one only and thank you for reply. so when we use @@identity it will get last identity field right.........it means one field value or total column......I think it returns only single value. one more...select Rank(1) from table update set=some column. it will get affect first row of the table ok. when i want 4th row should be execute is possible to give rank(4) .
modified on Friday, October 10, 2008 2:54 AM