transformation to use ??
Please help. I have to check this condition : (select count(distinct columnName) From tablename) > 1 Which transformation should i use for it .Thanks & Regards, Bhavika
April 16th, 2011 2:31am
Use execute sql task to save the value of the count in a variable. Then use precedence constraint with expression @[User::Count]>1 for moving to other task after Execute SQL task.Nitesh Rai- Please mark the post as answered if it answers your question
Free Windows Admin Tool Kit Click here and download it now
April 16th, 2011 2:51am
you can do it with Execute SQL Task in control flow, not transformation.
First create a package variable of type Int32, name it Count
then add an execute sql task in control flow
set connection
set sqlstatement as below:
select count(*) as cnt From tablename
then set resultSet property in general tab as single row
then in result set tab, set variable as User::Count . and set result name as cnt.
Now you fetched the count into User::Count variable. in the next step you can use precedence constraint to check this value . this is sample of using precedence constraint to implement IF condition in the control flow:
http://www.rad.pasfu.com/index.php?/archives/11-Implement-If-condition-in-SSIS-package.htmlhttp://www.rad.pasfu.com
April 16th, 2011 2:51am
Can you please explain in detail how to save a value of count in Variable. Till i know when we create a Variable we have to specific a HardCoded value at that time. so how do i do this at this time .Thanks & Regards, Bhavika
Free Windows Admin Tool Kit Click here and download it now
April 16th, 2011 3:09am
Reza has explained in detail on how to save the value of count in an integer variable. I would suggest you to understand execute sql task and its capabilities using
this link.Nitesh Rai- Please mark the post as answered if it answers your question
April 16th, 2011 3:20am
In the control flow , use Execute SQL task and configure the result set to Single row and create the result set varaible (integer). Put your sql statement in the task. Next use the expression @Count>1 in the success constrinat(connections between tassks).
Now if the question is on DF transformations , then its the conditional split whre a condition can be specifiedRequest to please mark my post as an answer if I helped you to resolve the issue or vote up if I helped you.Thanks. Regards and good Wishes, Deepak.
Free Windows Admin Tool Kit Click here and download it now
April 16th, 2011 3:20am
Thanks sooo much..Thanks & Regards, Bhavika
April 16th, 2011 3:45am