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 2005 Forums
 SSIS and Import/Export (2005)
 Exec SSIS package based on a file existence

Author  Topic 

sqlserverdeveloper
Posting Yak Master

243 Posts

Posted - 2008-05-13 : 17:28:56
I am not sure if we can execute SSIS package using t-sql, but I want to do the following:
Step1. Execute SSIS package1
Step2. Check for the file1.txt in c drive using the below code:
Declare @result int
exec xp_fileexist 'c:\file1.txt', @result output
IF (@result = 1) --if file exists exec ssis package
begin
Execute SSIS package2
end

If we can't use t-sql, please let me know how I can do that as part of sql job. Thanks!!

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2008-05-13 : 17:33:27
It took me about 30 seconds to find the answer by googling your problem. The answer is run dtexec to execute SSIS packages from the command line (or from xp_cmdshell).

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Database maintenance routines:
http://weblogs.sqlteam.com/tarad/archive/2004/07/02/1705.aspx
Go to Top of Page
   

- Advertisement -