Using a Stored Procedure to Transfer Data from a Text File to SQL Server

The Microsoft SQL Server development team provides sample code for a stored procedure that transfers data from a text file to SQL Server.

ITPro Today logo in a gray background | ITPro Today

Editor's Note: Send your SQL Server questions to Microsoft's SQL Server development team at [email protected].

What kind of stored procedure can I use to transfer data from a text file to SQL Server?

Listing 1 shows a stored procedure that transfers the data from a text file to SQL Server. You can also use Data Transformation Services (DTS), the T-SQL BULK INSERT statement, and the bulk copy program (bcp) utility to transfer the text data. For more information about these methods, see Curt A. Gilman, "The ABCs of Bcp," October 2001, InstantDoc ID 21926, and John Green, "Showdown—bcp vs. DTS," April 2001, InstantDoc ID 19760.

Sign up for the ITPro Today newsletter
Stay on top of the IT universe with commentary, news analysis, how-to's, and tips delivered to your inbox daily.

You May Also Like