Solved

COpy MS SQL tables from one server to another

Posted on 2014-10-10
2
145 Views
Last Modified: 2014-10-10
I have two servers (serverA and serverB) both containing MS SQL 2005. How do I copy tables from serverA to serverB using a Coldfusion program or a script? What is the best way to go about this ?
0
Comment
Question by:Errol Farro
2 Comments
 
LVL 48

Assisted Solution

by:Vitor Montalvão
Vitor Montalvão earned 250 total points
ID: 40372834
The easiest way is to use the Import/Export Wizard from SQL Server Management Studio. Just right-click on the database A from server A and chose Tasks/Export Data... and follow the wizard.

Other way is using T-SQL but you need to create first a Linked Server to server B on server A and then run a query similar to this one:
INSERT INTO ServerB.dbo.TableName
SELECT * FROM ServerATableName

Open in new window

0
 
LVL 2

Accepted Solution

by:
Pratik Makwana earned 250 total points
ID: 40372836
try this.......

Select * into ServerA.DestinationDB.dbo.tableName from ServerB.SourceDB.dbo.SourceTable

For generate script :
1.Right-click on the database name, then select "Tasks" then click on "Generate Scripts". After that, the Script Wizard opens. Click on "Next".
2. Select the Database you want to script.
3.Choose the object types. Click on "Next".
4.Select the tables.
5.Select the Output option for the script.
6.Change/Edit the database name to the name you want to execute this script for.
0

Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
SQL 2014 always on 31 58
Solar Winds can't see SQL Server Express 17 30
SQL Availablity Groups List 2 6
SQL View / Qtry 3 8
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
The Delta outage: 650 cancelled flights, more than 1200 delayed flights, thousands of frustrated customers, tens of millions of dollars in damages – plus untold reputational damage to one of the world’s most trusted airlines. All due to a catastroph…
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.

791 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question