dbTalk Databases Forums  

activex: run query and write to file

microsoft.public.sqlserver.dts microsoft.public.sqlserver.dts


Discuss activex: run query and write to file in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
kapsolas
 
Posts: n/a

Default activex: run query and write to file - 01-19-2006 , 12:32 PM






Hi to all,

I know that i can just create a transform task to run a query and set up a
destination file and dump the records that way.

however, i want to do something similar through activex scripting as
practice. I have figured out how to write to a file by creating a
FileSystemObject.

How can I write a query now and then traverse the result set and pull my
info out of it. Does this all need to be done through activex? or can i
somehow have something else in my dts package run the query and hand off the
result set to the activex script?

thanks.

Reply With Quote
  #2  
Old   
Allan Mitchell
 
Posts: n/a

Default Re: activex: run query and write to file - 01-21-2006 , 05:17 AM






Hello kapsolas,

One way to do it would be to use a Global Variable resultset. You then iterate
through that and write to your file as you go. You will do this in an Active
Script task.

http://www.sqldts.com/default.aspx?298


You are right though that this would be better and more easily done in a
Data Pump task.


Allan



Quote:
Hi to all,

I know that i can just create a transform task to run a query and set
up a destination file and dump the records that way.

however, i want to do something similar through activex scripting as
practice. I have figured out how to write to a file by creating a
FileSystemObject.

How can I write a query now and then traverse the result set and pull
my info out of it. Does this all need to be done through activex? or
can i somehow have something else in my dts package run the query and
hand off the result set to the activex script?

thanks.




Reply With Quote
  #3  
Old   
kapsolas
 
Posts: n/a

Default Re: activex: run query and write to file - 01-23-2006 , 10:20 AM



Hi Allan,

On Friday after I made my post regarding creating the active script to write
out to a file for me, I was able to quicky figure it out, was not that hard,
but one think I did do was make the actual call to get the result set with in
the active script. This also implies then that I needed to type up the
connection string in plain text. This is something that I would want to
avoid, since I dont want the credentials in plain site.

I will look into the method you list below through the use of the global
variable's result set. This would eliminate the need to create a connection
through the script to query the table.

Again thanks for the tip!!! I'll keep ya posted on my progress

"Allan Mitchell" wrote:

Quote:
Hello kapsolas,

One way to do it would be to use a Global Variable resultset. You then iterate
through that and write to your file as you go. You will do this in an Active
Script task.

http://www.sqldts.com/default.aspx?298


You are right though that this would be better and more easily done in a
Data Pump task.


Allan



Hi to all,

I know that i can just create a transform task to run a query and set
up a destination file and dump the records that way.

however, i want to do something similar through activex scripting as
practice. I have figured out how to write to a file by creating a
FileSystemObject.

How can I write a query now and then traverse the result set and pull
my info out of it. Does this all need to be done through activex? or
can i somehow have something else in my dts package run the query and
hand off the result set to the activex script?

thanks.





Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.