Try this solutions You try this way.Because @@Identity assign in temporary variable then fetch value of last inserted.
'SELECT FirstName + ' ' + LastName AS "Employee Name", IDENTITYCOL AS "Employee ID" FROM Northwind.dbo.Employees'.
or try this
'If the statement did not affect any tables with identity columns, @@IDENTITY returns NULL'
SELECT @@IDENTITY AS 'Identity'
Now u may get value of identity.This is my gess only.
If you get any ideas from the above i will really Appreciate you.
If you don't get any help from above i am really sorry.
Pls let me know.
my id is Ramesh.Nekkanti@indsys.ge.com
Regards
Ramesh