Skip navigation

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

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.

Hide comments


  • Allowed HTML tags: <em> <strong> <blockquote> <br> <p>

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.