Once you've set up the Linked Server, you can write SQL statements directly against the Linked Server. For example, you could write the statement INSERT INTO local_table…SELECT col1, col2,… FROM linked_server.db1.dbo.foo.
When importing data from text files, simply use the BULK INSERT statement or, my preference, call the BCP command line utility using XP_CMDSHELL within the stored procedure. It takes a little work to get the exact XP_CMDSHELL string correct. All you have to do is encapsulate the BCP command-line string within a parameter for XP_CMDSHELL extended stored procedure.
Do you have comments on this Ask the Expert Q&A? Let us know.
Dig Deeper on Microsoft SQL Server Installation
Related Q&A from Kevin Kline
I have an MS SQL Server 2000 database with a field which is a varchar(255). My clients understand that the text descriptions which they enter to ... Continue Reading
How can I transfer data from a SQL server to a mainframe without using FTP? I have an extremely large amount of data to transfer and FTP takes too ... Continue Reading
How does query processing in relational systems differ from the processing of low-level query languages? Continue Reading