February 8, 2012 at 7:50 am
I have a conditional spilt task that moves records based on Department Code.
This is a simplified Example:
Order Output Name Condition
1 HR Department == "HR"
2 IT Department == "IT"
3 IG Department == "IG"
If I get a value that is not in the list specified, has a null value or empty string I want to direct the row to a Table Name ErrorOutput.
When I try the following I get an error:
Department == "HR" OR Department == "IT" OR Department == "IG"
I would like to do NOT IN().
What other steps do I need to do to redirects the bad rows?
For better, quicker answers on T-SQL questions, click on the following...
http://www.sqlservercentral.com/articles/Best+Practices/61537/
For better answers on performance questions, click on the following...
http://www.sqlservercentral.com/articles/SQLServerCentral/66909/
February 8, 2012 at 8:03 am
The OR is the problem, I think. Try
Department == "HR" || Department == "IT" || Department == "IG"
February 8, 2012 at 10:22 am
Sorry I was not clear how about using NOT EQ.
For better, quicker answers on T-SQL questions, click on the following...
http://www.sqlservercentral.com/articles/Best+Practices/61537/
For better answers on performance questions, click on the following...
http://www.sqlservercentral.com/articles/SQLServerCentral/66909/
February 8, 2012 at 10:30 am
!=
Viewing 4 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply