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
 SQL Server Development (2000)
 starting a DTS package by receiving email

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2002-08-05 : 09:31:23
Marc writes "I am working with SQL Server 7 on an NT box. Data is periodically written to a text file and an automated e-mail message can be generated at the same time. I have a DTS written in VBScript to convert the text info into the format I need and place it into a table. I want to use an automatically generated e-mail message to start my DTS to avoid reusing old data from my text file (so I cannot simply poll by time). I can easily create a stored procedure to poll for new e-mail with the required sender and topic lines, but I cannot find out how to start a DTS from a stored procedure (dtsrun does not do it) and I cannot find out how to start a DTS when an e-mail message is received. How do I do what I want to do? Can I?

Thanks."

jasper_smith
SQL Server MVP & SQLTeam MVY

846 Posts

Posted - 2002-08-05 : 11:31:05
dtsrun DOES do it

e.g.

 
declare @dtscmd varchar(200)
declare @ret int

set @dtscmd='DTSRun /SSERVERNAME /N"UPDATE_XML" /E'
exec @ret=master..xp_cmdshell @dtscmd,no_output

If @ret<>0
begin
raiserror('Failed to run DTS Package',16,1)
end




HTH
Jasper Smith
Go to Top of Page
   

- Advertisement -