SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 SSIS Newbie - Need Help
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

urbanforum
Starting Member

1 Posts

Posted - 02/24/2014 :  23:08:02  Show Profile  Reply with Quote
Hi All,

I'll be transparent from the start here, I'm a VoIP guy and I have a requirement from my customer that requires checking a value in a table and files in a folder. The customer wants this in a SSIS package, no exceptions.

I really assumed that there would be a "IF" task in the toolbox, but I assumed wrong. All I'm trying to do is simply check if a particular query returns a result or not:
SELECT CallStatusZone1 FROM DL_5010_5010 WHERE CallStatusZone1 = 'P'

So if the result is P, to me it's true and I want the logic to go through some sort of true branch. If I don't get the result of 'P', I want to send the logic to another "IF" task that will check for the same query, except instead of 'P', it'll be 'C'. If I 'C' is returned, then I'm going to check a particular folder to see if a file exists.

At this point, I can't seem to get past the first part. I've spent several days banging my head against the wall watching youtube videos and reading tutorials - either I'm stupid or I just don't understand the SQL world

I'm on SQL 2008 R2

Thx

Edited by - urbanforum on 02/24/2014 23:08:30

kennejd
Starting Member

USA
11 Posts

Posted - 02/26/2014 :  15:03:19  Show Profile  Reply with Quote
You're correct...there is no 'IF ELSE' object in the SSIS toolbox...at least none that I'm aware of on the control flow. However, what I've done is use the Precedence Constraint to apply a condition. The Precedence Constraint is the (normally) green line that is connected between the objects. To apply a constraint, you will need to create an execute sql task with a single row result set at the point you want to test. Then double-click the green line and change the evaluation option to Expression and Constraint. You might want to google this for an example....probably easier than trying to follow my instructions...:)
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

India
52249 Posts

Posted - 02/27/2014 :  02:41:16  Show Profile  Reply with Quote
quote:
Originally posted by urbanforum

Hi All,

I'll be transparent from the start here, I'm a VoIP guy and I have a requirement from my customer that requires checking a value in a table and files in a folder. The customer wants this in a SSIS package, no exceptions.

I really assumed that there would be a "IF" task in the toolbox, but I assumed wrong. All I'm trying to do is simply check if a particular query returns a result or not:
SELECT CallStatusZone1 FROM DL_5010_5010 WHERE CallStatusZone1 = 'P'

So if the result is P, to me it's true and I want the logic to go through some sort of true branch. If I don't get the result of 'P', I want to send the logic to another "IF" task that will check for the same query, except instead of 'P', it'll be 'C'. If I 'C' is returned, then I'm going to check a particular folder to see if a file exists.

At this point, I can't seem to get past the first part. I've spent several days banging my head against the wall watching youtube videos and reading tutorials - either I'm stupid or I just don't understand the SQL world

I'm on SQL 2008 R2

Thx



see how to do this here
https://www.simple-talk.com/sql/ssis/working-with-precedence-constraints-in-sql-server-integration-services/

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/
https://www.facebook.com/VmBlogs
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.05 seconds. Powered By: Snitz Forums 2000