dbTalk Databases Forums  

Is there a "rows affected" variable ?

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


Discuss Is there a "rows affected" variable ? in the microsoft.public.sqlserver.dts forum.



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

Default Is there a "rows affected" variable ? - 07-19-2004 , 04:58 AM






Hi,

i have a DTS job that transform records from one database to another. Works
well.
But for my own logging I want to know how many rows affected by the
transformation job.
Is there any global variable that contains this information ?
I think there is one, because if I execute the DTS packet manually, the
enterprise
manager shows the rows transformed.

Thanks for any hints !!

cu
Axel



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

Default Re: Is there a "rows affected" variable ? - 07-19-2004 , 05:03 AM






There is no Global Variable that holds this information but there is a
property on the DataPump task

Have a look at this in BOL

mk:@MSITStore:C:\Program%20Files\Microsoft%20SQL%2 0Server\80\Tools\Books\dts
prog.chm::/dtsppropmr_05wp.htm

--

----------------------------

Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP)
www.SQLDTS.com - The site for all your DTS needs.
I support PASS - the definitive, global community
for SQL Server professionals - http://www.sqlpass.org


"Axel Stallknecht" <Axel.Stallknecht (AT) jm-textile (DOT) com> wrote

Quote:
Hi,

i have a DTS job that transform records from one database to another.
Works
well.
But for my own logging I want to know how many rows affected by the
transformation job.
Is there any global variable that contains this information ?
I think there is one, because if I execute the DTS packet manually, the
enterprise
manager shows the rows transformed.

Thanks for any hints !!

cu
Axel





Reply With Quote
  #3  
Old   
Axel Stallknecht
 
Posts: n/a

Default Re: Is there a "rows affected" variable ? - 07-19-2004 , 08:01 AM



Hi Allan,

first of all, thanks for your answer. That's what I need.
But can I use this in an SQL Statement, insted of a ActiveX script ?
I guess the only way to access this property is in an ActiveX script.
So I make a script which is setting the Rowcount as an Global variable.

Function Main()
Set oPkg = DTSGlobalVariables.Parent
DTSGlobalVariables("GoodRows").Value =
oPkg.Tasks("DTSTask_DTSDataPumpTask_1").Properties ("RowsComplete").Value
Main = DTSTaskExecResult_Success
End Function

But how can I use this variable in an SQL Task ?
In example :
execute [dbo].[sp_logTransfer] 'WS', 1,
DTSGlobalVariables("GoodRows").Value, ''

This won't work. I'm not sure if my ActiveX script is working as it should.
Thanks for your help.

cu
Axel


"Allan Mitchell" <allan (AT) no-spam (DOT) sqldts.com> schrieb im Newsbeitrag
news:%23Zb0seXbEHA.1292 (AT) TK2MSFTNGP11 (DOT) phx.gbl...
Quote:
There is no Global Variable that holds this information but there is a
property on the DataPump task

Have a look at this in BOL


mk:@MSITStore:C:\Program%20Files\Microsoft%20SQL%2 0Server\80\Tools\Books\dts
prog.chm::/dtsppropmr_05wp.htm

--

----------------------------

Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP)
www.SQLDTS.com - The site for all your DTS needs.
I support PASS - the definitive, global community
for SQL Server professionals - http://www.sqlpass.org


"Axel Stallknecht" <Axel.Stallknecht (AT) jm-textile (DOT) com> wrote in message
news:40fb9b32$0$297$4d4ebb8e (AT) read (DOT) news.de.uu.net...
Hi,

i have a DTS job that transform records from one database to another.
Works
well.
But for my own logging I want to know how many rows affected by the
transformation job.
Is there any global variable that contains this information ?
I think there is one, because if I execute the DTS packet manually, the
enterprise
manager shows the rows transformed.

Thanks for any hints !!

cu
Axel







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

Default Re: Is there a "rows affected" variable ? - 07-19-2004 , 08:26 AM



So you've grabbed your count of rows and want to reuse the Variable

Sure

Global Variables and Stored Procedure Parameters
(http://www.sqldts.com/Default.aspx?234)

--

----------------------------

Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP)
www.SQLDTS.com - The site for all your DTS needs.
I support PASS - the definitive, global community
for SQL Server professionals - http://www.sqlpass.org


"Axel Stallknecht" <Axel.Stallknecht (AT) jm-textile (DOT) com> wrote

Quote:
Hi Allan,

first of all, thanks for your answer. That's what I need.
But can I use this in an SQL Statement, insted of a ActiveX script ?
I guess the only way to access this property is in an ActiveX script.
So I make a script which is setting the Rowcount as an Global variable.

Function Main()
Set oPkg = DTSGlobalVariables.Parent
DTSGlobalVariables("GoodRows").Value =
oPkg.Tasks("DTSTask_DTSDataPumpTask_1").Properties ("RowsComplete").Value
Main = DTSTaskExecResult_Success
End Function

But how can I use this variable in an SQL Task ?
In example :
execute [dbo].[sp_logTransfer] 'WS', 1,
DTSGlobalVariables("GoodRows").Value, ''

This won't work. I'm not sure if my ActiveX script is working as it
should.
Thanks for your help.

cu
Axel


"Allan Mitchell" <allan (AT) no-spam (DOT) sqldts.com> schrieb im Newsbeitrag
news:%23Zb0seXbEHA.1292 (AT) TK2MSFTNGP11 (DOT) phx.gbl...
There is no Global Variable that holds this information but there is a
property on the DataPump task

Have a look at this in BOL



mk:@MSITStore:C:\Program%20Files\Microsoft%20SQL%2 0Server\80\Tools\Books\dts
prog.chm::/dtsppropmr_05wp.htm

--

----------------------------

Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP)
www.SQLDTS.com - The site for all your DTS needs.
I support PASS - the definitive, global community
for SQL Server professionals - http://www.sqlpass.org


"Axel Stallknecht" <Axel.Stallknecht (AT) jm-textile (DOT) com> wrote in message
news:40fb9b32$0$297$4d4ebb8e (AT) read (DOT) news.de.uu.net...
Hi,

i have a DTS job that transform records from one database to another.
Works
well.
But for my own logging I want to know how many rows affected by the
transformation job.
Is there any global variable that contains this information ?
I think there is one, because if I execute the DTS packet manually,
the
enterprise
manager shows the rows transformed.

Thanks for any hints !!

cu
Axel









Reply With Quote
  #5  
Old   
Axel Stallknecht
 
Posts: n/a

Default Re: Is there a "rows affected" variable ? - 07-20-2004 , 04:55 AM



Thanks for your help, Allan. All my problems are gone. ;-)

cu
Axel
"Allan Mitchell" <allan (AT) no-spam (DOT) sqldts.com> schrieb im Newsbeitrag
news:ePjFPQZbEHA.3524 (AT) TK2MSFTNGP12 (DOT) phx.gbl...
Quote:
So you've grabbed your count of rows and want to reuse the Variable

Sure

Global Variables and Stored Procedure Parameters
(http://www.sqldts.com/Default.aspx?234)

--




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.