Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Import/Export (DTS) and Replication (2000)
 Generating CSV data dumps

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2002-02-15 : 08:44:22
Amit writes "Hi.

I have an SQL 7 database which I am using to collect stats data from users to my site.

What I need is a way of dumping the contents of a table into a csv file so I can import it into another stats pacakge.

Is there a way to get SQL7 to schedule regular dumps of specified tables to a CSV file?

Thanks

Amit"

robvolk
Most Valuable Yak

15732 Posts

Posted - 2002-02-15 : 12:05:49
Sure, this is very easy to do using Data Transformation Services (DTS). SQL Server Enterprise Manager allows you to create DTS packages very easily. Once you create a package, you create a connection to the SQL Server where you want to get data from, another connection to the text file you wish to output to, and connect them with a Transform task containing the query or table name that gives you that data. There is a wizard that can do this for you as well; you can then save the package and examine or edit it as needed.

Once the package is created, you can right-click on it and choose Schedule. This will create a job that runs the DTS package at the dates and times you specify. Books Online has details on how all of these work, and you can probably figure it out by trying.

You can also use the bcp command-line utility to export data to a CSV file, then create a job to run this command the same way you can schedule DTS. Again, look in Books Online under "bcp" and "jobs" for more information.

Go to Top of Page

AjarnMark
SQL Slashing Gunting Master

3246 Posts

Posted - 2002-02-15 : 13:31:56
quote:
You can also use the bcp command-line utility to export data to a CSV file, then create a job to run this command the same way you can schedule DTS.


Or, because bcp is a command-line utility, you can also schedule this in any other external task scheduler.

------------------------
GENERAL-ly speaking...
Go to Top of Page
   

- Advertisement -