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
 Transact-SQL (2000)
 Running DTS based on conditions

Author  Topic 

Ste_Donkin
Starting Member

6 Posts

Posted - 2004-06-14 : 07:52:53
Hi

I am trying to create a scheduled DTS package that checks for a text file and then if the file exists, continue with the DTS otherwise exit without classifying as as failure.

I have 1 stored procedure that checks for the file and what I would like to do is use an output parameter that the DTS can use for the conditional logic as to whether to continue processing or not.

CREATE PROCEDURE [dbo].[sp_Check_File_Exists] @FilePath varchar(500) AS

declare @i int
exec master..xp_fileexist @FilePath, @i output

What I am having difficulty with is getting the value of @i to be returned into the DTS package so I can run a logic test on it and if neccessary end the DTS.

Has anyone got a suitable way of doing this or can suggest a better alternative?

Thanks in advance
Steve




ditch
Master Smack Fu Yak Hacker

1466 Posts

Posted - 2004-06-14 : 07:56:16
We have a fileexists custom task (a dll written in vb).
If the required file does not exist we return an error.

MSDN has quite a bit of info on writting custom tasks for dts.


Duane.
Go to Top of Page

JasonGoff
Posting Yak Master

158 Posts

Posted - 2004-06-14 : 08:00:32
The other thing you can do is write an ActiveX script step that then uses the FileSystemObject to check for file existence, and then return Step_Success or Step_Fail. You can then use the DTS workflow to run the rest of the package based on Success condition.
Go to Top of Page
   

- Advertisement -