dbTalk Databases Forums  

Set global with count of rows transformed

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


Discuss Set global with count of rows transformed in the microsoft.public.sqlserver.dts forum.



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

Default Set global with count of rows transformed - 01-28-2005 , 04:16 PM






Apparently DTS already keeps count of the rows it processes. I'll
just bet there's some way of putting in a post-source or pump-complete
handler that accesses that number, rather than keep my own count by
incrementing a global on each row.

I've only just been introduced to the mystery of the multiphase data
pump, so, does anybody have the magic word on how to use it to capture
the row count in one swell foop?

Thanks.

Josh


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

Default Re: Set global with count of rows transformed - 01-29-2005 , 12:56 AM






This is a very quick example for you


Function Main()

dim tsk

set tsk =
DTSGlobalVariables.Parent.Tasks("DTSTask_DTSDataPu mpTask_1").CustomTask

DTSGlobalVariables("RowsSuccess").Value = tsk.RowsComplete
DTSGlobalVariables("RowsBad").Value = tsk.RowsInError


MsgBox "Success = " & DTSGlobalVariables("RowsSuccess").Value & " and Bad =
" & DTSGlobalVariables("RowsBad").Value

Main = DTSTaskExecResult_Success
End Function

--



Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP)
www.SQLDTS.com - The site for all your DTS needs.
www.SQLIS.com - You thought DTS was good. here we show you the new stuff.
www.konesans.com - Consultancy from the people who know


"JRStern" <jxstern (AT) bogus (DOT) com> wrote

Quote:
Apparently DTS already keeps count of the rows it processes. I'll
just bet there's some way of putting in a post-source or pump-complete
handler that accesses that number, rather than keep my own count by
incrementing a global on each row.

I've only just been introduced to the mystery of the multiphase data
pump, so, does anybody have the magic word on how to use it to capture
the row count in one swell foop?

Thanks.

Josh




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

Default Re: Set global with count of rows transformed - 01-31-2005 , 07:48 PM



On Sat, 29 Jan 2005 06:56:26 -0000, "Allan Mitchell"
<allan (AT) no-spam (DOT) sqldts.com> wrote:
Quote:
This is a very quick example for you

Function Main()

dim tsk

set tsk =
DTSGlobalVariables.Parent.Tasks("DTSTask_DTSDataPu mpTask_1").CustomTask

DTSGlobalVariables("RowsSuccess").Value = tsk.RowsComplete
DTSGlobalVariables("RowsBad").Value = tsk.RowsInError

MsgBox "Success = " & DTSGlobalVariables("RowsSuccess").Value & " and Bad =
" & DTSGlobalVariables("RowsBad").Value

Main = DTSTaskExecResult_Success
End Function
Looks great, thanks!

Josh



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.