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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CSV to Table

Status
Not open for further replies.

grrreg

Programmer
Sep 15, 2002
6
0
0
CA
Hi there folks,
Is it possible to within a stored procedure access data held in a CSV file on the server? I have data in a CSV that I need to use to update a table. Currently I'm using DTS to push it to a temp table and then running a query to update it. I need to automate the process where I can save the file to a folder with a particular filename and have a scheduled proc that will do the updates and delete the file.

I am really stumped as to where to start on this so any and all advice or ideas are very very very appreciated.

Thanks all,

Greg
 
You can schedule the DTS package to run whenever you like, and you can add to the package an Execute SQL task after the import to run your update query.

Alternatively, you can look into BULK INSERT and BCP to do the import from a stored procedure rather than DTS, and continue the procedure with your update query. Schedule the procedure to run whenever you like.

Yet another way would be to write a procedure to execute the DTS package and then run your update query. Schedule the procedure to run whenever you like.

Good luck!

--John [rainbow]
-----------------------------------
Behold! As a wild ass in the desert
go forth I to do my work.
--Gurnie Hallock (Dune)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top