conditional task to execute the package
Hi Gurus,
I have created a new package to load the data from Oracle to SQL Server.
We ant to run the package if max(source date)=Max(Destination) then should execute.
For ex: Source date and Destination date is 07-May-2012 then package should execute otherwise not.
Kindly help me how to write the conditional task for this.
Thanks in advance.
May 7th, 2012 2:32am
Would suggest
a) Intoroduce a load table on destination, which woud capture the load status, with start dates and finsih dates.
b) Whenever the new load starts check this table with the max start date, with status success.
c) Then use this date as paramter to run against the source, to fetch the reordsAbhinav
Free Windows Admin Tool Kit Click here and download it now
May 7th, 2012 2:36am
Retrieve both dates with Execute SQL Tasks (I assume you stored these in tables in one or more databases) and store the results in two variables.
After the last Execute SQL Task, drag a precedence constraint to the rest of your package.
Double click on the arrow, set the condition to Expression and Constraint.
For the expression, use:
@MaxSourceDate == @MaxDestinationDate
MCTS, MCITP - Please mark posts as answered where appropriate.
May 7th, 2012 2:42am
What is the volume of data we are looking at? Querying for MAX on large tables is not good, specifically for such a case.Please vote as helpful or mark as answer, if it helps
Cheers, Raunak | t: @raunakjhawar |
My Blog
Free Windows Admin Tool Kit Click here and download it now
May 7th, 2012 2:43am
Thanks for the reply.
I am very new to SSIS. Please help to provide the steps on Table EMP,colun hirdate.
May 7th, 2012 2:58am
Read this article first:
http://www.sqlis.com/sqlis/post/The-Execute-SQL-Task.aspx
Use the following SQL query:
SELECT MAX(hirdate) FROM EMP;
MCTS, MCITP - Please mark posts as answered where appropriate.
Free Windows Admin Tool Kit Click here and download it now
May 7th, 2012 3:02am
I didn't understand how to implement the steps shown in the link.
How to do that,please provide simple steps. Thanks
May 7th, 2012 5:21am
I cannot explain it any simpler than the article.
Read the section "Returning a Single Value, Passing in Two Input Parameters".
Ignore the input parameters part, it's returning the single value you are interested in.MCTS, MCITP - Please mark posts as answered where appropriate.
Free Windows Admin Tool Kit Click here and download it now
May 7th, 2012 5:31am
Try this..
select 'JuneBoy' where exists (select '1' where <<max_of_source_date>>=<<max_of_destination_date>>)
In your case as Koen has rightly suggested, fetch the values from each of the table and use a similar syntas as above. This is one of the option with the information available.Please vote as helpful or mark as answer, if it helps
Cheers, Raunak | t: @raunakjhawar |
My Blog
May 7th, 2012 5:47am
Hi All,
I am confusing how to make the link between two different databases(oracle and SQL Server 2005).
We want to run this package on monthly basis.
So we should include recovery also. For eg: If we not run the package on first of any of the month due to any failure, we should include the steps in the package.
Kindly help.
Free Windows Admin Tool Kit Click here and download it now
May 7th, 2012 11:25pm
Hi Juneboy,
1. You can download
Microsoft Connectors v1.2 for Oracle and Teradata provider to connect to oracle database, for detail steps, please see:
http://blogs.msdn.com/b/sqlperf/archive/2009/08/14/using-ssis-to-get-data-out-of-oracle-a-big-surprise.aspx
2. You can schadule the package in SQL Server Agent job, and speciy the job to run monthly. For details step, please see:
http://msdn.microsoft.com/en-us/library/ms141701.aspx
3. I suggest you can use Koen Verbeeck's suggestion.
Thanks,
Eileen
May 14th, 2012 3:08am


