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)
 Export temp table

Author  Topic 

lebedev
Posting Yak Master

126 Posts

Posted - 2002-07-19 : 11:01:11
I created a DTS package that takes a query and a file name as parameters. It then creates a temporary table, populates it with query result (done with Execute SQL Task), and tries to export this table into a file (done with Data Pump). It works fine if the table is static, i.e. it's name doesn't start with a #, and fails with "object not found" error otherwise. I understand that it fails because a temp table is visible only within one user connection, and each packages step is executed with a separate connection, thus temp table created in one step is not visible to another.
Is there a way to run all steps in one connection or do this some other way?
thanks.

Page47
Master Smack Fu Yak Hacker

2878 Posts

Posted - 2002-07-19 : 11:27:16
Why not just make the data pump task source the query?

If you must build a table, you can create a global temp table using ## or just use a 'static' table...

<O>
Go to Top of Page

lebedev
Posting Yak Master

126 Posts

Posted - 2002-07-19 : 12:38:04
I tried to pass query straight to Data Pump Task and it worked great.
However, I want to be able export different queries using this package, and it seems that column transformation, used in Data Pump will work for one particular query, unless I remap transformations at run time. But how can I do this?
For example: when I pass query "select * from Objective" it works fine, howerver when I pass query "select objid from Objective" I get an error saying "field objName not found".
thanks.

Go to Top of Page

lebedev
Posting Yak Master

126 Posts

Posted - 2002-07-19 : 17:29:25
Does anybody know how to change Data Pump column transformations at run time? I want to be able to export any kinds of queries to a file.
thanks.

Go to Top of Page
   

- Advertisement -