Chad Osgood's Blog

Chad Osgood's Old, Expired Blog

Executing a SQL Server DTS in .NET

I use SQL Server DTSs to import data from flat files exported from various systems, and recently a need came up to allow the end-user of a Windows Forms application serving up ActiveReports reports to control this process (previously scheduled with SQL Agent).  I've done this quite easily in the past using the COM component, but not yet in .NET.  I googled for PIAs for SQL Server with no luck; however, I happened upon this useful resource which includes a free cookbook on using DTSs within .NET; a worthwhile read for those who haven't worked with DTS packages outside of Enterprise Manager before.  

What I would really like is the ability to execute a SQL Agent job asynchronously and be notified when it was completed.  In the past I executed the job with sp_start_job and polled the results of sp_help_job for that particular job to see when it was completed. 

Comments

Frans Bouma said:

The DTS package is a VB coded package, you can generate VB code with DTS, so you can add code to f.e. call a com component that signals your .NET service or call that service directly.
# June 17, 2003 4:26 AM

Chad Osgood said:

Good idea, Frans. Thanks!
# June 17, 2003 5:06 PM

ThinkBling said:

Implementing this with a DTS package, one can dynamically set the database username, database password or nearly all other properties from the application.
# April 15, 2004 4:25 PM
Leave a Comment

(required) 

(required) 

(optional)

(required)