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)
 Dynamic Export of a table to tab delimited text file with col names in first line.

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2003-07-10 : 07:28:34
Dan writes "I have to be able to dynamically export tables to a tab delimited text file with the column names as the first line.

The table names, destination file names, and column names are not known until execution time.

I can execute BCP using xp_cmdshell to dynamically export the tables, but not with the column names on the first line.

I can export the tables with DTS, but not dynamically. I can change the source table and destination file dynamically, but not the transformation parameters. The transformation is a simple column copy, the destination fields determined by the source columns.

I created a DTS package to export sample table and saved the package as VB code. The plan is to generalize the code so I can pass parameters to the package prior to execution. There is an awful lot of code. It seems like overkill.

This seems like a very simple process. Is there a better way?

I am running Windows 2000 Professional and SQL Server 2000.

Thanks,

Dan Healy"
   

- Advertisement -