Click here to Skip to main content
16,007,687 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi ,

My can someone tell me how to insert data from For example There is a table1 in a Database1 and table2 in Database2 columns in both the tables are same table1 have a flag which will be updated as 1 when the data is inserted in table2 in database2.
can anyone tell me how to do this?
Posted

1 solution

this an example you have to add all columns between Brackets except Identity Column

SQL
insert into Database1.dbo.Table1
select (AllCOl except identity Col)  from Database2.dbo.Table2
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900