Click here to Skip to main content
15,896,557 members
Please Sign up or sign in to vote.
3.50/5 (2 votes)
See more:
i want to copy record another database same table using following query

insert into newdatabase.newtablename select * from olddatabase.oldtablename

without using where condition

i ma also use this query but not getting any success

insert into Pharma1314.dbo.general_master
select * from Pharma.dbo.general_master where not exists (select * from Pharma1314.dbo.general_master)
Posted

1 solution

If your SQL Server version 9.0 (2005) or higher you could use MERGE[^] statement to achive this goal, or to use SQL Server replication[^] for 8.0 and higher versions.
 
Share this answer
 
Comments
manoj s sherje 5-Dec-13 4:36am    
thanks for replying i ma really trying to use

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