Hi Everyone ! im using SQL SERVER 2005,
My problem is, i am inserting a set of values into a table using a subquery, the problem occurs when i tried to get the auto generated column in the table which iam trying to insert.
ex:
create procedure Sample
@ID
Insert into sampleTable1(name,name2,name3)
(Select name,name2,name3 from sampleTable2 where SID=@SID)
Here i try to insert a set of values into the sampleTable1 By passing a parametter values(@ID), After inserting i tried to get the autoGenerated column in the sampleTable1
I tried with the Scope Identity, but i think this wil not work out in a large network,
@@Identity as IID
I need a alternative solution for this
Kindly provide me with a valid solution
Thanks in advance !