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)
 Changing Names and No. of Columns

Author  Topic 

leedoolan
Starting Member

12 Posts

Posted - 2002-06-24 : 11:29:48
Here is a real teaser for anybody who can help.

I want to export varying sql query results weekly into csv files.

The query text is to be looked up from a table, and then update a datapump sql statement and destination filename.

I can manage to update the datapump sql statement, and change the destination filename however the problem occurs when the query passes back varying columns from previous weeks etc. That is sometimes 5 columns, and sometimes 10 etc and also with different names.

So when the datapump executes with the new sql statement the following message occurs:
- - - - - "Column name '?????' was not found."

I presume some how I need to manipulate the transformations, i.e. change the destination columns, or refresh the transformation?

Any ideas would be most appreciated.

Lee Doolan

Page47
Master Smack Fu Yak Hacker

2878 Posts

Posted - 2002-06-24 : 11:34:33
To the best of my knowledge, the package object in the api does not expose a transformations collection. I don't have sql 2k infront of me, but I seem to remember going down this road and never figuring out how to 'refresh' the automappings in code...

Not to knock you back a couple steps, but can't you do the same thing in a stored procedure by dynamically building a call to bcp out?

<O>
Go to Top of Page

setbasedisthetruepath
Used SQL Salesman

992 Posts

Posted - 2002-06-24 : 11:34:46
It sounds like a bcp out command would be a more suitable choice for you, since with DTS you would need to redefine the transformation when the column list changed.

Jonathan Boott, MCDBA
Go to Top of Page

setbasedisthetruepath
Used SQL Salesman

992 Posts

Posted - 2002-06-24 : 11:35:30
sniped!!

Jonathan Boott, MCDBA
Go to Top of Page

leedoolan
Starting Member

12 Posts

Posted - 2002-06-26 : 05:05:22
Thanks for your replies however maybe I should have mentioned that the query is made on an Ingres DB and therefore I can't use BCP. Or can I?

I was wondering can you not simply delete the datapump and then recreate the step or something after changing the source query and destination filename?, thus refreshing the transformations??

Go to Top of Page
   

- Advertisement -