Solved

COpy MS SQL tables from one server to another

Posted on 2014-10-10
2
142 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 46

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Recently while working on a project I got a very annoying cfdocument has no body error message. I had never seen this error before. So I checked the code. The code was pretty simple; it was Just showing me the cfdocumnt tag and inside that tag a …
JSON is being used more and more, besides XML, and you surely wanted to parse the data out into SQL instead of doing it in some Javascript. The below function in SQL Server can do the job for you, returning a quick table with the parsed data.
Via a live example, show how to set up a backup for SQL Server using a Maintenance Plan and how to schedule the job into SQL Server Agent.
Via a live example, show how to shrink a transaction log file down to a reasonable size.

911 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

16 Experts available now in Live!

Get 1:1 Help Now