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)
 scheduling dts packages on variable dates

Author  Topic 

mcp111
Starting Member

44 Posts

Posted - 2006-03-09 : 13:30:50
I have a dts package that needs to run on a different date every month. The dates are stored in a sql server table. How can I schedule this package?

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2006-03-09 : 13:39:31
Here's one way:

DECLARE @Date datetime
SELECT @Date = YourColumn
FROM YourTable

IF @Date = CONVERT(varchar(10), GETDATE(), 101)
EXEC master.dbo.xp_cmdshell 'dtsrun.exe ...'


So you'll use xp_cmdshell to run the DTS package. If the date in the table is today's date, then execute it. Otherwise, do nothing.

Tara Kizer
aka tduggan
Go to Top of Page
   

- Advertisement -