开发者

attach a table to a database from another database

开发者 https://www.devze.com 2023-02-05 00:25 出处:网络
I\'m working on MSSQL 2008. And i want to insert a table that is already in db1, t开发者_JAVA百科o another database db2. so i want to copy the table with attributes and content.

I'm working on MSSQL 2008. And i want to insert a table that is already in db1, t开发者_JAVA百科o another database db2. so i want to copy the table with attributes and content. Can i do this?

Thank you..


If you just want the bare minimum table definition, without any constraints or indexes:

use db2
go

select * into dbo.NewTable from db1.dbo.OriginalTable
0

精彩评论

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