<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>BI Monkey &#187; SQL Agent</title>
	<atom:link href="http://www.bimonkey.com/tag/sql-agent/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.bimonkey.com</link>
	<description>James Beresford on Microsoft BI and Consulting in Sydney, Australia</description>
	<lastBuildDate>Mon, 23 Jan 2012 22:01:56 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=</generator>
		<item>
		<title>Preventing SQL Agent Jobs calling SSIS reporting failure</title>
		<link>http://www.bimonkey.com/2009/08/preventing-sql-agent-jobs-calling-ssis-reporting-failure/</link>
		<comments>http://www.bimonkey.com/2009/08/preventing-sql-agent-jobs-calling-ssis-reporting-failure/#comments</comments>
		<pubDate>Mon, 31 Aug 2009 07:47:25 +0000</pubDate>
		<dc:creator>BI Monkey</dc:creator>
				<category><![CDATA[Microsoft BI]]></category>
		<category><![CDATA[Event Handlers]]></category>
		<category><![CDATA[SQL Agent]]></category>

		<guid isPermaLink="false">http://www.bimonkey.com/?p=572</guid>
		<description><![CDATA[The ETL Control system I have in place has a series of parent and child packages, the lowest child of which can possibly and legitimately fail, and the Control flows I have in place gracefully handle that possibility, logging the failures back to Audit / Control database. However, whenever a task fails, the error gets [...]]]></description>
			<content:encoded><![CDATA[<p>The ETL Control system I have in place has a series of parent and child packages, the lowest child of which can possibly and legitimately fail, and the Control flows I have in place gracefully handle that possibility, logging the failures back to Audit / Control database.</p>
<p>However, whenever a task fails, the error gets reported up the Parent / Child package chain all the way to the SQL Agent Job running the control framework and the SQL Agent job itself reports failure. This gives the wrong impression to anyone viewing the job history &#8211; it looks like the job has failed when in fact it has run just fine, handling the problems it encountered.</p>
<p><a id="ctl00___ctl00___ctl00_ctl00_bcr_bth___BlogTitle" title="Rushabh Mehta" href="http://sqlblog.com/blogs/rushabh_mehta/default.aspx">Rushabh Mehta</a> presents an elegant solution in this post: <a title="Gracefully Handing Task Error in SSIS Package" href="http://sqlblog.com/blogs/rushabh_mehta/archive/2008/04/24/gracefully-handing-task-error-in-ssis-package.aspx">Gracefully Handing Task Error in SSIS Package</a>. His solution is to create an OnError Event Handler for the task that can possibly fail, and in that Event Handler find the System Variable <strong>Propagate</strong> and set its value to False. What the Propagate property does is decide whether Error messages are propagated up through the package. By setting it to false, you tell the package not to send Error messages up the execution chain. The Event Handler itself doesn&#8217;t have to <em>do </em>anything, it just has to exist and have the Propagate property set to False. This way the task can fail, not cause the SQL Agent Job to fail, but still allow handling of Errors in the Control flow through the normal use of Precendence constraints.</p>
<p>Unfortunately if you have a chain of Parent &#8211; Child packages this doesn&#8217;t quite work. If you try to apply this technique to an Execute Package task, it doesn&#8217;t work because if the Child package fails at any point &#8211; even if you prevent errors propagating up from inside the Child package, the Parent package will still raise errors and report failure. What I have found is that you have to have an Event Handler that prevents the propagation of errors at each step in the chain of packages that call that child package &#8211; so if you have Parent &gt; Parent &gt; Parent &gt; Child, stopping propagation of errors in the Child isn&#8217;t enough to get the SQL Agent Job to believe it succeeded, you need to stop error propagation at each Execute Package task. I have a set of <a title="Parent Child Package Error Propagation Samples (Right Click, Save As)" href="http://www.bimonkey.com/uploads/ssis/Parent Child Package Error Propagation.zip">sample packages demonstrating this process here.</a> It appears the only way to ignore errors at the bottom level is to ignore errors at every level, which is not a good approach.</p>
<p>As far as I can tell this is a bug, so I have <a title="SSIS - Propagate property has no effect on Parent Packages" href="https://connect.microsoft.com/SQLServer/feedback/ViewFeedback.aspx?FeedbackID=486780">reported it on connect</a>.</p>
<p>If anyone has a solution to this problem I would be grateful to hear it &#8211; I don&#8217;t want to disable errors in every called package, just stop them propagating from the Execute Package Task at the bottom of the chain.</p>
<p><strong><span style="color: #ff0000;"><em>Connect Update 18 Aug 2010: </em></span></strong></p>
<p><em>Looks like this won&#8217;t get fixed as it currently stands, the response from Microsoft was to Close it as &#8220;By Design&#8221;:</em></p>
<blockquote><p><em>The &#8220;propagate&#8221; value only controls if an event should be propagated up<br />
repeatedly. It doesn&#8217;t affect if the event is propagated to the client.<br />
For child task, client is the parent package.</p>
<p>We looked the issue and decided that we cannot change the current<br />
behavior. To address the issue properly, we will consider introducing<br />
option like &#8220;Propagate to client&#8221; in the future.<br />
</em></p></blockquote>
<p><strong></strong><em> This does actually make sense architecturally &#8211; so we will just have to hope that the &#8220;Propagate to client&#8221; property becomes a reality.</em></p>
]]></content:encoded>
			<wfw:commentRss>http://www.bimonkey.com/2009/08/preventing-sql-agent-jobs-calling-ssis-reporting-failure/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Passing variables from SQL Agent to SSIS</title>
		<link>http://www.bimonkey.com/2008/04/passing-variables-from-sql-agent-to-ssis/</link>
		<comments>http://www.bimonkey.com/2008/04/passing-variables-from-sql-agent-to-ssis/#comments</comments>
		<pubDate>Tue, 01 Apr 2008 04:07:26 +0000</pubDate>
		<dc:creator>BI Monkey</dc:creator>
				<category><![CDATA[Integration Services]]></category>
		<category><![CDATA[SQL Agent]]></category>

		<guid isPermaLink="false">http://www.bimonkey.com/?p=6</guid>
		<description><![CDATA[This is as much to remind myself as help everyone else out there, as I had to ring a former client to get the answer it took me a long to me to dig out last time I attempted this. It is possible to pass a value from SQL Agent into a variable in SSIS. [...]]]></description>
			<content:encoded><![CDATA[<p>This is as much to remind myself as help everyone else out there, as I had to ring a former client to get the answer it took me a long to me to dig out last time I attempted this.</p>
<p>It is possible to pass a value from SQL Agent into a variable in SSIS. You need to predefine the variable within the package &#8211; assume it&#8217;s called <strong>strAgentInput </strong>in the <strong>Control </strong>namespace.</p>
<p>In the SQL Agent step that is calling the package, you&#8217;ll note a tab in the options called &#8220;<strong>Set Values</strong>&#8220;. To pass a value into a variable, enter in the <strong>Property Path</strong> column (including the leading backslash):<br />
<span style="color: #993366;"><br />
<strong>\Package.Variables[Control::strAgentInput].Value </strong></span></p>
<p>Vary the namespace and variable name as per your package needs. You can also see the <span style="color: #993366;">.Value</span> property of the variable is being set here &#8211; you can set any other variable property here &#8211; but you <span style="text-decoration: underline;">must</span> set a property. If you do not specify which property you are setting, nothing will get set.</p>
<p>To set the actual value, enter what you need in the Value column. What gave me so much trouble was entering a file path. The correct syntax for file paths is:<br />
<span style="color: #993366;"><br />
<strong>&#8220;C:\Program Files\Microsoft SQL Server\90\DTS\Packages\\&#8221;</strong></span></p>
<p>Note the string is surrounded by double quotes and the final slash of the path is escaped by a backslash. Any other variation will lead to your string output having &#8220;/REPORTING E&#8221; tagged on the end of it. Which drove me insane trying to figure out. Hopefully i&#8217;ve saved you some pain.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bimonkey.com/2008/04/passing-variables-from-sql-agent-to-ssis/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

