SQL Server - COPYING DATA FROM ANOTHER DATABASE AT SIMULTANEOUSLY
Asked By kumar on 14-Feb-12 06:00 AM
HOW TO INSERT THE RECORD IN ONE DATABASE TABLE AND IT SIMULTANEOUSLY INSERT INTO ANOTHER DATABASE TABLE.
StudentDetails table in STUDENT database and StudentInfo in Employee database and i want to insert record on StudentDetails same time the record should be inserted into studentInfo in Employee database
Venkat K replied to kumar on 14-Feb-12 06:19 AM
Inserting records to multiples database at same time is practically not possible, you need to use Transactions to maintain synchronization between two databases
BEGIN TRAN T1
INSERT INTO StudentInfo SELECT * from tblname
INSERT INTO StudentDetails SELECT * from tblname
COMMIT TRAN T1
ROLLBACK TRAN T1
hope this helps!