Friday, July 24, 2020

Importing tables from One Server to another server  Using SQL Server Management Studio (SSMS)


   Part - 12


Click here or below for you tube Answer







 → Copy data from one or more tables or views (As-Is) (Option 1)


To transfer the data go to target server and click on Tasks  → Import data


Click on next on SQL Server Import Export Wizard
Provide Data Source, Server Name and Database Name

Choose the Destination Server / Target Server

Select option 1 for copy data from one or more tables or views



Provide the Target table names, you can click on preview to see the sample data, then click on 
Next. You can check Save SSIS Package as well if you want to rerun it in future.


Click on Next and then Finish and then the data will be transferred to the target database

You can also view or save the log report


Opt



Similar Schema will be created at the Target Server:




 → Write a custom query to specify the data to transfer 

Follow the same steps and choose 2nd option and click on Next

Provide the Custom Query and Click on Next
Parsed the query and the SQL Statement is Valid


On Preview

Click Next --> Next and Finish and then table will be imported

Tables in the target server:

Summary:


If you want to import the data as well as the table constraints, edit as shown below:


Once you provide the required destination table, Click on Edit Mapping. Then Edit SQL option will be shown which would open a window to provide the auto generated SQL just to import the data with out constraints. 

Provide here the schema same as Source table for the destination table. Which would import the table with schema as as source.

Explore other options on the Edit SQL window.

No comments:

Post a Comment

  Printing Number Pattern using SQL Link for video answer: SQL: --********************* --PRINT Pattern --********************* -- 1 -- ...