views:

81

answers:

2

Hello All,

Suppose you have two linked servers called Local and Remote respectively.

Is there a syntax that compresses (and uncompresses) the data required to be sent from the Local to Remote (or vice versa).

For example, if I am updating my Local database with data from my Remote database, I would do the following:

INSERT INTO [Local Server].[Local DB Name].dbo.[Table]
SELECT *
FROM [Remote Server].[Remote DB Name].dbo.[Table]

Is there a syntax I can apply that compresses the data being sent from Remote to Local hence reduce the bandwidth costs and execution time involved?

+1  A: 

You could use the SQL Server bcp utility to copy out your data, compress it yourself and then transmit it to the remote server. Also, uploading into the database is far quicker than using insert statements.

Adamski
Combining this with Cade Roux' zip file recommendation might help -- but only if you're talking seriously big sets of data to be copied across. The savings would come from using bulk-import logging and not having one huge transaction, with commensurate impact on the log file.
Philip Kelley
+1  A: 

There is not anything built into SQL Server.

An alternative is to send it to a file, zip the file, transfer it and bring it in on the other side. It is possible to automate this all from one side with things like xp_cmdshell.

Cade Roux
Thanks for that!
Nai