Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Import/Export (DTS) and Replication (2000)
 How do I run a DTS package from ASP

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2002-06-03 : 08:37:21
Linda and Karin writes "We have created a DTS-package that creates a flatfile from a table in our database. This package is meant to be run when we update the table that eventually will be exported as a flatfile. The table is to be updated from an ASP site. How do we easily solve this problem.
Sincerely
/ Linda and Karin"

dataphile
Yak Posting Veteran

71 Posts

Posted - 2002-06-03 : 09:00:16
Create a task 'TheTask' by scheduling the DTS. Do not specify a time/date.

Create a trigger on update&insert on the table that does the following:
USE msdb
EXEC sp_start_job @job_name = 'TheTask'

The job will execute no matter whether the table gets updated from ASP or WAP or whatever.

------------------
If you don't want to create a trigger just execute

USE msdb
EXEC sp_start_job @job_name = 'TheTask'

as embedded SQL in the ASP.

Go to Top of Page

hismightiness
Posting Yak Master

164 Posts

Posted - 2005-04-19 : 15:18:24
(For those who may search and find this post like I did.)

This worked for me...

==============================================================
CREATE TRIGGER [dbo].[MYTRIGGERNAME] 
ON MYTABLENAME
AFTER INSERT, UPDATE
AS
EXEC msdb.dbo.sp_start_job @job_name = 'MYJOBNAME'
==============================================================

However, it is necessary to remind people to not create the trigger in Enterprise Manager - but rather in SQL Query Analyzer. It will not save otherwise. Also, just creating a DTS package is not enough. You also need to have it scheduled for this example to work properly and reference the JOB NAME, not the DTS Package name.

These were my stumbling blocks, so I am sure that someone else will benefit from it. :)

- - - -
- Will -
- - - -
http://www.servicerank.com/
Go to Top of Page
   

- Advertisement -