dbTalk Databases Forums  

PackageSQLServer.EnumStepLogRecords: displaying steplog records of running package

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


Discuss PackageSQLServer.EnumStepLogRecords: displaying steplog records of running package in the microsoft.public.sqlserver.dts forum.



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

Default PackageSQLServer.EnumStepLogRecords: displaying steplog records of running package - 04-13-2004 , 04:30 AM






I have a problem displaying the correct steplog records of a running dts
package. When I start a job which executes a dts package and try to display
the current log records of this package right after starting the job, I get
log records of the previous 'run'. Waiting a few seconds before getting the
steplog records usually helps, but I want to display them right away (like
running a dts package in enterprise manager).

To get the steplog records of the running package I do the following:

1. get the latest PackageLogRecord, by executing

PackageSQLServer.EnumPackageLogRecords( "package name", true, "", "", "" )

2. find the PackageLogRecord with the latest date in this collection (should
be the log record of the currently running package?)

3. execute PackageSQLServer.EnumStepLogRecords with the LineageFullID of the
PackageLogRecord found in step 2.

It seems to me that there is a delay of some sort in writing the package log
entry in sql server. Do I need to flush something or call refresh on some
object?

Any ideas?

Regards,

Andrew



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

Default Re: PackageSQLServer.EnumStepLogRecords: displaying steplog records of running package - 04-13-2004 , 03:24 PM






In message <#8EO1nTIEHA.2836 (AT) TK2MSFTNGP11 (DOT) phx.gbl>, Andrew
<nospamplease@?.?.invalid> writes
Quote:
I have a problem displaying the correct steplog records of a running dts
package. When I start a job which executes a dts package and try to display
the current log records of this package right after starting the job, I get
log records of the previous 'run'. Waiting a few seconds before getting the
steplog records usually helps, but I want to display them right away (like
running a dts package in enterprise manager).

To get the steplog records of the running package I do the following:

1. get the latest PackageLogRecord, by executing

PackageSQLServer.EnumPackageLogRecords( "package name", true, "", "", "" )

2. find the PackageLogRecord with the latest date in this collection (should
be the log record of the currently running package?)

3. execute PackageSQLServer.EnumStepLogRecords with the LineageFullID of the
PackageLogRecord found in step 2.

It seems to me that there is a delay of some sort in writing the package log
entry in sql server. Do I need to flush something or call refresh on some
object?

Any ideas?

Regards,

Andrew

If you want info up front then you should use the object model, and
enumerate steps in the package. You can also use events you get progress
info more efficiently than polling via TSQL.

There are some samples and alos KB links in this article for using
events -

Execute a package from Visual Basic (VB)
(http://www.sqldts.com/default.aspx?208,1)
--
Darren Green (SQL Server MVP)
DTS - http://www.sqldts.com

PASS - the definitive, global community for SQL Server professionals
http://www.sqlpass.org



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.