开发者

Copy (or USE) data from two tables in different databases [duplicate]

This question already has answers here: Closed 12 years ago.

P开发者_运维问答ossible Duplicate:

Possible to perform cross-database queries with postgres?

I don-t know how to use one table from one database and second table from another databse at the same time or copy data from table in one database to table from another databse. I tried following query:

select * into NewTable from existingdb.dbo.existingTable;

But it doesnt't work.


In existing table name, specify the full path. that's database name and table table to be copied. In New table also specify the database name and table name or make sure the console is in same database.

Also verify both the tables have same table structure.


What is the exact error message? It would not work if NewTable already exists. Then you should type insert into NewTable select * from ExistingDb.dbo.ExistingTable.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜