[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 611
  • Last Modified:

Read DTS Log Status

Hi all,

I have the following code which runs a DTS package:

        Dim oPackage As DTS.Package = New DTS.Package()
        oPackage.LoadFromSQLServer( _
            ServerName:="SQLSVR1", _
            Flags:=DTS.DTSSQLServerStorageFlags.DTSSQLStgFlag_UseTrustedConnection, _
            PackageName:="CO_PRODUCT_IMPORT")
        oPackage.Execute()
        oPackage.UnInitialize()
        oPackage = Nothing

This DTS package simply imports a CSV file into an SQL Server 2000 table, appending the data onto existing data.

My question is, how can I read the DTS package log status (Success or Fail) from within my VB.NET Windows app?

I am using VS 2005 and SQL Server 2000.

Thanks.
0
FMabey
Asked:
FMabey
  • 2
1 Solution
 
nmcdermaidCommented:
Assuming this is DTS and not SSIS, there's a bunch of sysdts* tables in MSDB, including sysdtspackagelog and sysdtssteplog
If this is indeed DTS then I can go and dig up a view I have that lets you interrogate the logs (there's a bit of table joining required)
0
 
FMabeyAuthor Commented:
nmcdermaid,

This is indeed DTS. If you could provide me with those views that would be great.
0
 
James MurrellProduct SpecialistCommented:
For this u need to set the dts logging option

Package --> properties --> select logging tab and specify a table or text file (should be on the local drive) to log the dts activity andstores the details in the table or text file
0
 
nmcdermaidCommented:
I can't find the script and I dont have SQL 2000 installed. Luckily I think someone's already done it.
 http://www.planet-source-code.com/vb/scripts/ShowCodeAsText.asp?txtCodeId=354&lngWId=5
0

Featured Post

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now