Greg
Greg

Reputation: 45

How do I create an SSIS package that executes a bat file

I am trying to create a job in SQL Server Management Studio using an SSIS package to execute a bat file. The bat file sets in motion an FTP transfer as well as file renaming and archiving. I have tested the bat file and it executes properly with all steps completed. The problem I am running into is with the SSIS package. I am not a frequent user of Visual Studio so it is quite possible I am overlooking something. On the control flow tab I added an "Execute process task". I specified both the file path for the bat file and the working directory. I verified this set up against other existing jobs we have in place that also execute bat files. When I tell the job to run, it says it has completed successfully with no errors. When I manually verify the results, the bat file has not been executed. I do not know what I am overlooking here. The SSIS package and the bat file reside on the same server, and the appropriate shares exist for the file transfer. Any ideas as to what I may have missed would be appreciated.

Upvotes: 2

Views: 1399

Answers (1)

Rachel Ambler
Rachel Ambler

Reputation: 1604

Why? Why not do this inside SSIS using the supplied FTP Task? In addition you can do all the file renaming you want using the File System Task.

FTP Task: https://learn.microsoft.com/en-us/sql/integration-services/control-flow/ftp-task

File System Task: https://learn.microsoft.com/en-us/sql/integration-services/control-flow/file-system-task

Updated after latest comment:

If the built-in component doesnt work for you, have you considered 3rd party components such as https://winscp.net/eng/docs/guide_ssis

That component seems to use WinSCP as a backend

Upvotes: 2

Related Questions