Quantcast
Channel: SQL Server Integration Services forum
Viewing all articles
Browse latest Browse all 24688

Exception handling when calling SQLCMD through Execute Process Task in SSIS

$
0
0

Hi All,

I have a requirement to call SQLCMD through Execute Process Task through generate a SQL query output file. I have to stick with using SQLCMD (instead of using Execute SQL task and File Connection) since it gives the exact output format (proper headers and format as it comes out in SSMS query editor) as required for reporting through mail. I am able to execute this part properly with the query output stored in a text file

The issue is with exception handling in case the SQLCMD query (in my case a stored procedure) through some error. Currently the error message goes into the file and Execute Process task completes successfully. I want to make the Execute Process task fail in case the procedure execution fail.

One option I can think of is to check the file contents to see if contains any error and make the package fail. Does anyone else have a better idea of handling this scenario? Maybe some option in Execute Process task that I am overlooking.

Thanks in advance

Regards

Manoj 


Viewing all articles
Browse latest Browse all 24688

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>