Home > Archive > MS SQL Server DTS > January 2006 > activex: run query and write to file









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author activex: run query and write to file
kapsolas

2006-01-19, 1:23 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.
Allan Mitchell

2006-01-21, 7:23 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



> 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.
>



kapsolas

2006-01-23, 11:24 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:

> 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
>
>
>
>
>
>

Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com