SP or DTS to export data to csv

  • I am trying to export some data on a regular basis to CSV files. This is to be used as an import file to another application.

    The trick here is that I want to split up the data into seperate files based on the job column. So all data for job 123 would go to 123_import.csv, job 456's data goes in 456_import.csv etc.

    The problem is that the jobs will change over time and the way's I've see in DTS packages need a named file as the destination. Is there a way to dynamically create the file and its name somehow and then save the data?

    Thought about using a cursor where I grab all of the job numbers, then I can add that to the where clause to restrict the data, but its still at the file creation that I get stumped.

  • Here is an article that may help. It describes how to use the DTS Dynamic properties task in SQL Server.

    http://www.databasejournal.com/features/mssql/article.php/3559551

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply