Wednesday, March 28, 2012

How to transfer a table between databases in SQL Server 2005 express

Hi,

In SQL Server 2005 Express I currently have 2 databases which I’m working on, my problem is I want to transfer a table from one of the databases to the other but don't know how to go about achieving this? I want the table structure and all the info held within the table transferred across. Any ideas are welcome.

hi,

using SSMSE, generate the DDL script of the table you like to "copy"...

execute the resulting script in the target database..

then insert all the rows in the original table like

INSERT INTO dbo.Table SELECT col1, col2, coln FROM originalDatabase.dbo.Table;

regards

No comments:

Post a Comment