Solved

COpy MS SQL tables from one server to another

Posted on 2014-10-10
2
139 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 45

Assisted Solution

by:Vitor Montalvão
Vitor Montalvão earned 250 total points
Comment Utility
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
Comment Utility
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

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

I spent nearly three days trying to figure out how incorporate OAuth in Coldfusion for the Eventful API. Hopefully, this article will allow Coldfusion Programmers to buzz through the API when they need to. Basically, what this script does is authori…
Ever wondered why sometimes your SQL Server is slow or unresponsive with connections spiking up but by the time you go in, all is well? The following article will show you how to install and configure a SQL job that will send you email alerts includ…
Using examples as well as descriptions, and references to Books Online, show the different Recovery Models available in SQL Server and explain, as well as show how full, differential and transaction log backups are performed
Using examples as well as descriptions, and references to Books Online, show the documentation available for datatypes, explain the available data types and show how data can be passed into and out of variables.

771 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now