Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 Inserting Record

Author  Topic 

haroon2k9
Constraint Violating Yak Guru

328 Posts

Posted - 2010-11-08 : 08:28:16
hi,

tableA

pkid casename
1 test
2 abcd


tableb
pkid pkidofa userid
1 1 123456


i mean,wen a record insert into the TableA,want to get that latest record of pkid(scope_identity()) OF tABLEA and this id passed to the tableB of pkidofa.


any sample code would be much appreciated.

Sachin.Nand

2937 Posts

Posted - 2010-11-08 : 08:32:27
Have a look at the new OUTPUT clause.

http://msdn.microsoft.com/en-us/library/ms177564.aspx

PBUH

Go to Top of Page
   

- Advertisement -