May 14, 2015 at 6:17 pm
have 3 sequence containers. each evaluate two variables being equal to each other.
Right now IF any of those pair aren't equal the package just stops running, which means there's no notification of failure.
I want the package to stop and throw an error.
way to do?
--Quote me
May 14, 2015 at 9:07 pm
polkadot (5/14/2015)
have 3 sequence containers. each evaluate two variables being equal to each other.Right now IF any of those pair aren't equal the package just stops running, which means there's no notification of failure.
I want the package to stop and throw an error.
way to do?
You cannot make a precedence constraint fail, it is not a task.
If you are using condition "@a=@b"
Then, what you can do is - Add one more precedence constraint to your tasks where you can put "@a!=@b" and then add a script task and add code to fail that task. Example -
Microsoft.SqlServer.Dts.Runtime.DTSExecResult.Failure
____________________________________________________________
APMay 15, 2015 at 6:52 am
Is that two Logical And precedence constraints per sequence container, one with @a==@b connecting to next sequence container and a second @a!=@b followed by a script task ???
Also, not familiar with C#. I cut pasted given script into main section of template inside script task like this and it is giving error.
public void Main()
{
// TODO: Add your code here
Dts.TaskResult = (int)ScriptResults.Success;
Microsoft.SqlServer.Dts.Runtime.DTSExecResult.Failure;
}
}
}
Please advise.
--Quote me
May 17, 2015 at 10:02 pm
public void Main()
{
// TODO: Add your code here
Microsoft.SqlServer.Dts.Runtime.DTSExecResult.Failure;
}
____________________________________________________________
APMay 18, 2015 at 10:51 am
with just that one line inside public void Main(), I get squiigly red line under the whole of Microsoft.SqlServer.Dts.Runtime.DTSExecResult.Failure; and error.
public void Main()
{
// TODO: Add your code here
Microsoft.SqlServer.Dts.Runtime.DTSExecResult.Failure;
}
===================================
Package Validation Error (Package Validation Error)
===================================
Error at Script Task: The binary code for the script is not found. Please open the script in the designer by clicking Edit Script button and make sure it builds successfully.
Error at Script Task: There were errors during task validation.
(Microsoft.DataTransformationServices.VsIntegration)
------------------------------
Program Location:
at Microsoft.DataTransformationServices.Project.DataTransformationsPackageDebugger.ValidateAndRunDebugger(Int32 flags, DataWarehouseProjectManager manager, IOutputWindow outputWindow, DataTransformationsProjectConfigurationOptions options)
at Microsoft.DataTransformationServices.Project.DtsPackagesFolderProjectFeature.ExecuteTaskOrPackage(ProjectItem prjItem, String taskPath)
when I build as directed the error is
"Only assignment, call, increment, decrement, and new object expressions can be used as a statement."
Can you see reason why?
--Quote me
May 18, 2015 at 11:05 am
I found this site http://stackoverflow.com/questions/25670293/ and modified as follows.
public void Main()
{
// TODO: Add your code here
Dts.TaskResult = (int)ScriptResults.Failure;
return;
}
this builds and fails the ssis package if the != is true.
Look right to you, Anshul?
--Quote me
May 18, 2015 at 10:03 pm
this builds and fails the ssis package if the != is true.
Look right to you, Anshul?
Looks fine to me.
Cheers.
____________________________________________________________
APMay 19, 2015 at 1:58 pm
thank you so much staying with me. Package is deployed!
--Quote me
Viewing 8 posts - 1 through 7 (of 7 total)
You must be logged in to reply to this topic. Login to reply