Groups | Blog | Home
all groups > sql server new users > may 2006 >

sql server new users : Copying a table (and data) from an SQL database to an external SQL database?


dave m
5/30/2006 11:18:20 AM
With MS Access, I was able to use then SELECT INTO statement to move data
between databases by the use of the IN clause to a newly created table in an
external database, such as . .

SELECT * INTO tablename1 IN 'msaccess database path and name' 'DBTYPE FROM
tablename2

tablename1 will be a newly created table in the external database,
tablename2 is a connected database table.



Can the same be done with SQL Server? Any help would be greatly
appriciated.

Andrew J. Kelly
5/30/2006 8:28:16 PM
If the other database is on the same server you simply do this:

SELECT * INTO OtherDB.owner.TableName FROM ThisTable

If it is on another server you can use the Import / Export wizard.

--
Andrew J. Kelly SQL MVP


[quoted text, click to view]

AddThis Social Bookmark Button