0

Possible Duplicate:
Copy tables from one database to another in SQL Server

I am trying to copy the data of one table into another table and both are of different Database say DB1 and DB2.Tables to create are TB1,TB2.but I am facing problem in doing so.The approach is SELECT * INTO temp2.dbo.B FROM temp.dbo.A and the error coming is

ERROR: syntax error at or near ".." LINE 2: INTO ui..golden_records_data ^

* Error *

ERROR: syntax error at or near ".." SQL state: 42601 Character: 19

Community
  • 1
  • 1
Khyati Sehgal
  • 375
  • 1
  • 6
  • 21
  • [Already asked question](http://stackoverflow.com/questions/187770/copy-tables-from-one-database-to-another-in-sql-server) You can visit this link.It is same as you what you want.This question already asked. – Suresh Feb 21 '12 at 12:26

1 Answers1

0

try this query

insert into database1.table1(fields) select fields from database2.table1; 
Naveen Kumar
  • 4,543
  • 1
  • 18
  • 36