dbTalk Databases Forums  

Recordset within DTS

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


Discuss Recordset within DTS in the microsoft.public.sqlserver.dts forum.



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

Default Recordset within DTS - 10-07-2003 , 09:37 AM






If I am executing a Data Driven Query within DTS, how can I determine the
number of rows returned by the SQL query for the source? Somehow, I need to
retrieve this value into a variable within the ActiveX script for the row
transformation. What I am hoping to do is execute a function within the
script whenever the last row in the recordset is reached.

If someone can provide an example, I would GREATLY appreciate it.

-Bill



Reply With Quote
  #2  
Old   
Darren Green
 
Posts: n/a

Default Re: Recordset within DTS - 10-07-2003 , 09:53 AM






You can't do this within the same task, as it does not now it has reached
the end, until it already has. Best bet would be to run a separate query
before hand, SELECT COUNT(*) ... and store the number in a global variable.
You will also need to use another global variable as a current row counter,
and check the two in the ActX script.

Or

Could you not move the functionality out to a following task. You can then
use a simple row counter or the RowComplete property to get the number of
rows processed by the DDQ.


--
Darren Green
http://www.sqldts.com


"Bill" <WBeatty (AT) Prodigy (DOT) Net> wrote

Quote:
If I am executing a Data Driven Query within DTS, how can I determine the
number of rows returned by the SQL query for the source? Somehow, I need
to
retrieve this value into a variable within the ActiveX script for the row
transformation. What I am hoping to do is execute a function within the
script whenever the last row in the recordset is reached.

If someone can provide an example, I would GREATLY appreciate it.

-Bill





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

Default Re: Recordset within DTS - 10-07-2003 , 10:13 AM



I was thinking about moving the functionality of the SOURCE sql statement
inside the ActiveX script using an ADO connection. Then I could use the
recordset object to determine the EOF.

If I can't get that to work the way I intend, I may try your first solution.

Thanks

"Darren Green" <darren.green (AT) reply-to-newsgroup-only (DOT) uk.com> wrote in
message news:OIVuYLOjDHA.548 (AT) TK2MSFTNGP11 (DOT) phx.gbl...
Quote:
You can't do this within the same task, as it does not now it has reached
the end, until it already has. Best bet would be to run a separate query
before hand, SELECT COUNT(*) ... and store the number in a global
variable.
You will also need to use another global variable as a current row
counter,
and check the two in the ActX script.

Or

Could you not move the functionality out to a following task. You can then
use a simple row counter or the RowComplete property to get the number of
rows processed by the DDQ.


--
Darren Green
http://www.sqldts.com


"Bill" <WBeatty (AT) Prodigy (DOT) Net> wrote in message
news:%23Ej4OCOjDHA.724 (AT) tk2msftngp13 (DOT) phx.gbl...
If I am executing a Data Driven Query within DTS, how can I determine
the
number of rows returned by the SQL query for the source? Somehow, I
need
to
retrieve this value into a variable within the ActiveX script for the
row
transformation. What I am hoping to do is execute a function within the
script whenever the last row in the recordset is reached.

If someone can provide an example, I would GREATLY appreciate it.

-Bill







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.