Saturday, May 6, 2023

How to import a table from an SQL Server into another SQL Server?

The way to import a table from one SQL Server to another SQL Server is very easy.

SQL Server provides a feature to Import and Export data or complete objects to another or even the same environment. That utility is Import and Export Wizard in SQL Server Management Studio (SSMS). The Import and Export Wizard provides the facility to import or export data/objects between different data sources like flat file, SQL Server, Sybase, MySQL, Oracle, Access and Excel etc.

There are multiple ways to import or export. A few of them are given below for your knowledge. Suppose we want to import a table from one SQL Server to another SQL Server:

Step 1: Connect to the Source SQL Server Instance.

Step 2: Click on Database Tree View & Expand. 

Expand Database

 
Step 3: Select the database in which the table is available.



Step 4: Right Click on the database & select Export. Keep in mind, we have connected Source SQL Server Instance. Hence, we need to select Export. If we connect the Destination SQL Server Instance, then we need to select Import because we want to bring the data from the source to the destination SQL Server Instance. 

Step 5: Choose the Data Source & Source Server Name

Data Source


Step 6: Choose the Destination Server Name

Step 7: Specify whether we want to transfer a table or want to use any T-SQL to fetch & transfer data. 

Step 8: Select  Source & destination table name. We can change the destination table name as per our requirement. We can map both tables on the basis of columns. 

Step 9: Now we need to specify whether it is only one-time activity or we'll use it in the future to transfer data between the same objects. If it is a one-time activity, then just check the Run Immediately checkbox & if we want to create & save the package for the future, we can use SSIS Package.

Step 10: Finally, it displays a screen with all details like Source & destination Server Name, Object Name, and other details for you to review & confirm to proceed.

Step 11: At the end, it displays the task completion status.

Task Status



No comments:

Post a Comment

Featured Post

Use DBCC SQLPerf (logspace)

 Use DBCC SQLPerf (logspace) to monitor and optimize database performance in SQL Server. Let's Explore: Let's Explore: https://mades...

Popular Posts