attach a table to a database from another database
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
精彩评论