Sunday, April 16, 2017

Insert Data from one Database Table to another Database Table on Different Server

Today we are going to learn how to insert data from one database server table to another database server table.
So let’s start writing the query.

Insert into [Server/Machine Name].[Database Name].[Schema].[Table Name]
Select * from [Server/Machine Name]. [Database Name].[Schema].[Table Name]

If you want to pick specific columns then you will write this query like this

Insert into [Server/Machine Name]. [Database Name].[Schema].[Table Name](Column1,Column2)
Select Column1, Column2 from [Server/Machine Name]. [Database Name].[Schema].[Table Name]

Comments and Suggestions are Always Welcome!

No comments:

Post a Comment