Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Import a CSV using Stored Procedures

Status
Not open for further replies.

penguin321

Programmer
Sep 20, 2001
7
US
Sorry if this has been covered before, but is there a way to import a CSV file using stored proecedures. We have a nightly routine which updates data into SQL, and part of that routine will require reading from a CSV or TXT file. I'm hoping to use what SQL already has available instead of writing my own code to parse the file, etc.

Any help would be appreciated. Thanks.
 
Hi,

Yes it's possible using the BULK INSERT with the 'formatfile' option. You can use teh bcp program to generate a formatfile for your table & input file.
Sunaj
'The gap between theory and practice is not as wide in theory as it is in practice'
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top