SSIS package with multiple constraints - ssis

Shown below is part of an SSIS package that runs daily. My objective is to execute the task 'Get Greaterthan500 Count on Mondays' only on Mondays. However, I want the 'Send Mail Task' to be executed on all days.
This is not working. How can I achieve this?

Put the fist 2 in a sequence container.
Then have the send mail outside the sequence container and the send email will always be hit

Related

SSIS event handler script task

i have a package that has several event handlers that execute a script task on failure when the package fails.. Problem is its generating a email that i have NO IDEA how.. When the package fails it executes a stored procedure that grabs the email distribution list from a SQL table and sends an email. However one email is being sent out to ppl who are not with the company and ive been told twice to change the DL list.. I checked the SQL table and the people that are getting the email are not listed any where in the distribution list.. Is there any way to search anywhere in the package to find out how the email is being generated. Ive spent hours and hours going through the scrip tasks and the code is no where to be found
You can use the package explorer (to the right of the event handler tab) to navigate through the entire package and look at the event handlers for every executable. It's possible that there are multiple event handlers, one at the package level and maybe one defined on a particular task, which is hardcoded with email addresses.
You can also, right click on the package in the solution explorer and select View Code. This will open the package in xml, which you can then use ctrl+F to find a certain string.
Advice Section
While you didn't ask for it, please let me add a few words of guidance. Event handlers are evil for this very reason. They are a hidden GOTO that you are lucky to notice at all, even if you've developed the package in the first place.
If event handling is required, use the precedence constraints in the control flow. Throw everything in a container, connect it to the script task and define the constraint to trigger on failure.
To go one step further, keep your emails out of your ssis packages. Use SQL agent or whatever scheduler you are using to post messages about failures.

SSIS Mail Triggered wrongly

i have a SSIS Package which schedule to check in every 10 min for the file,
and Once the file placed in the path, it execute and triggered mail.
The issue is even when file not placed it start sending mail in every 10 min.
How to handle it.
You should handle this by correcting the code that checks for the file and sends the mail.

SSIS- SQL AGENT Sending Mail for Each hour

i have designed a SSIS Package which will load some data to table
from the file available in a folder.
once data got loaded file move to archieve.
Client requested to have mail trigger at the end of process, so i implement
it through send mail task.
The pooling mechanism was done via agent job which run after evry 1 hour
to check existence of file.
The problem starts here.
it start sending mail every 1 hr to user
will it be possible to do some modification.
Thanks You All...... i think my question was not clear. The Problem i am facing is my package is start trigger mail every 1 hour, even when there is no file in source folder. i want to trigger mail when there is a file in Source folder, and after processing the file mail should get triggered, so user can come to know that file which they placed in the folder is got processed. But in present scenario, because i used agent job, which is checking for the file every 1 hour, even if file is not there mail is getting triggered to user. Please help me on this.
Can any one please suggest how can i rectify it.
Thanks
Yes, there are numerous ways to handle this depending on what you want to do.
They all involve only sending the email if some condition is true. You will have to decide what that condition is, and then that will suggest the best way to handle it.
You can set a variable and use an expression in the precedence constraint to only go to the Send Mail Task if the variable is true, for example.
If you want to look at a more complicated set of conditions, you can use a script task.
I would have sent mail only if the package fails. Not sure, your purpose of sending mail to the Client.
If the issue is sending mail every 1 hour is too much for the client.
Send mail if package fails and keep the status of every hour in a file (Using Script task, use variable to get the current Hour and write the Hour and Status to file) and send a consolidated mail at the end like.
Date: 09/23/2016
Hr - STATUS
-------------
00 - SUCCESS
01 - FAILED
.
.
.
23 - SUCCESS
If you want to send the consolidated mail at particular time, use the Variable used in precedence constraint before the send mail task.
Edit:
As per your update on clarification. Create a boolean variable to get the existence of the file using script task. Use that variable in precedence constraint before the Send Mail task.
http://sql-articles.com/articles/bi/file-exists-check-in-ssis/
Also, Refer

CRM Plug-In Call retrieves a subset of Invoice Lines when creating an Invoice from an order

We are developing a CRM plug-in that would be triggered whenever an Invoice is Generated in CRM from an Order.
The typical action would be going to a Sales Order and clicking on “Create an Invoice”.
The end game of the plug-in is to integrate the Invoice into a Remote system along with the header and lines.
Plug-in works in the following way:
Plugin is registered with the CRM Invoice for the “Create” Event.
Plugin runs “Asynchronously” via a Post operation of the Invoice Header.
Upon hitting “Create Invoice”, UI Action; Plugin sends the newly created Invoice GUID to a service, this is typically a POST operation:
a. We Basically make a call to an ASPX page which accepts this request and processes it.
b. Processing includes steps by:
i. Getting the invoice header through a CRM Service Retrieve call.
ii. Getting the Invoice Lines through a CRM Service Retrieve multiple call.
c. Commit the Invoice to the 3rd Remote Application Database.
d. We respond to the Plug-in by wrapping any custom status or error messages.
All the processes finishes in less than a minute.
Scenarios We tested on our end:
Case 1:
Invoice Containing 5-10 Lines
Steps 3(a). till 3(d). runs successfully and integrated the Invoice with all the lines.
Case 2: ISSUE
Invoice Containing more than 10 (Tested with 15-40 lines)
Step 3b(ii) . Invoice Lines Retrieval process retrieves only some lines and not all the lines
Initially we thought, there could be a Read lock for the current Authenticated user for CRM SDK, as the logged in user was also same, when the CRM is creating lines for the Invoice.
But the test failed there too.
Successful Scenario Tested:
We retrieved the Invoice Lines separately through a different call by delaying the call for some seconds. The number of lines retrieved was successful. But not sure what delay the server would take.
We require your inputs on this issue to move forward in order to resolve this as we may be making some mistakes while doing this Plugin request call.
Thanks And Regards.
I know that this question is a year old but I'm still looking for a solution to it so I figure other people might be too.
My experience is that CRM needs to save (Create) the header record before it can associate the lines to it. Because you have registered it for Async execution, there is a slight delay before it executes which gives it time to have saved some of the lines before you try and load them.
So far my best solution is to trigger the plugin on the Create message of invoicelines, count all of the lines associated with that invoice and either pass a row count from the order or count the lines on the order and when they have the same count, execute your main body of code. It is pretty inefficient for orders with a lot of rows. But it is a solution.

How can i stop the package with more than 1 dataflow if the first fail?

I've a SSIS package with more than 1 data Flow, If the 1st Dataflow fail I don't want to execute the follows. How can I stop the execution of the package. I tried using red arrow and script task doing nothing but I it doesn't work. the others dataflows are executed as well getting all the errors to my .net client. I need only the error for the Data flow that fail.
Anyone know how can I get it
Thanks
You can set MaximumErrorCount To 1 on your data flow task, but this is the default value. Same goes for the value at package level, if you set this to 1, the package terminates with error if you task fails.
But as i said, these are default values and you shouldn't have anything to do. Do you execute the data flow tasks all together? If you do, build one path which executes all the tasks after another.
You can use the Squence Container and put all the data flow task in it. I have shared the screen shot of the sample, adjust the priority for all the data flow task and put sucess condition for the tasks.