DTEXEC does not fail when SSIS package fails

I need to run my SSIS 2012 packages through the catalog with DTEXEC. This works very well, except that if my SSIS package fails, DTEXEC does not fail. I need DTEXEC to fail, so my scheduler knows that there is an error.
I use the following command:
dtexec /ISServer "\SSISDB\MyFolder\MyProject\MyPackage.dtsx" /Ser MyServer /Par $Package::Partition;201412 /Env 5
When I check the status of the run in the Catalog, it is failed.
When I used SSIS 2008, I had no problem getting DTEXEC to fail when the packages failed.

I've had the same problem, and come up with the following prototype for a SQL Script which I run in our JAMS Enterprise Scheduler. It uses SSISDB stored procedures to start the SSIS package and polls every 5 seconds to report any messages, and final
status code of the package. JAMS parameters are delimited by << >> symbols, and will need to be changed for your scheduler/batch process. I guess the script could be converted to a stored procedure. I'm also hoping it will work with SQL High
Availability groups to ensure the SSIS package runs on the server that's hosting the active database.
DECLARE @execution_id BIGINT
DECLARE @status INT= 1
DECLARE @Event_Message_id BIGINT= 0
DECLARE @Last_Event_Message_id BIGINT= 0
DECLARE @message_time DATETIME2(7)
DECLARE @message NVARCHAR(MAX)
--Create a SSIS execution for the required SSIS package and return the execution_id
EXEC [SSISDB].[catalog].[create_execution] @package_name = N'<<pPackageName>>.dtsx',
    @execution_id = @execution_id OUTPUT, @folder_name = N'<<pSSISFolderName>>',
    @project_name = N'<<pSSISProjectName>>', @use32bitruntime = <<p32Bit>>, @reference_id = NULL
RAISERROR('Starting SSIS package <<pPackageName>> with execution_id %I64d on server %s',0,0,@execution_id,@@SERVERNAME) WITH NOWAIT
--Set the logging level 0-none, 1-basic (recommended), 2-performance, 3-verbose
EXEC [SSISDB].[catalog].[set_execution_parameter_value] @execution_id,
    @object_type = 50, @parameter_name = N'LOGGING_LEVEL',
    @parameter_value = <<pLogging_Level>>
--Start the package executing
EXEC [SSISDB].[catalog].[start_execution] @execution_id
WHILE @status IN ( 1, 2, 5, 8 ) --created (1), running (2), canceled (3), failed (4), pending (5), ended unexpectedly (6), succeeded (7), stopping (8), and completed (9).
    BEGIN
        WAITFOR DELAY '00:00:05'
    --Get the status to see later if we've finished
        SELECT  @status = status
        FROM    SSISDB.catalog.executions
        WHERE   execution_id = @execution_id 
    --Are there any event messages since we last reported any?
        DECLARE curEventMessages CURSOR FAST_FORWARD
        FOR
            SELECT  event_message_id ,
                    message_time ,
                    message
            FROM    SSISDB.catalog.event_messages
            WHERE   operation_id = @execution_id
                    AND event_message_id > @Last_Event_Message_id;
        OPEN curEventMessages
        FETCH NEXT FROM curEventMessages INTO @Event_Message_id, @message_time,
            @message
        WHILE @@FETCH_STATUS = 0
            BEGIN
        --We've found a message, so display it - watch out for % signs in the message, they'll cause an error if we don't replace them
                SET @message = CONVERT(NVARCHAR(MAX), @message_time, 113)
                    + ' ' + replace(@message,'%',' percent')
                RAISERROR(@message,0,0) WITH NOWAIT
                SET @Last_Event_Message_id = @Event_Message_id --Make a note that we've reported this message
                FETCH NEXT FROM curEventMessages INTO @Event_Message_id,
                    @message_time, @message
            END
        CLOSE curEventMessages
        DEALLOCATE curEventMessages
    END
--@Status indicates that package execution has finished, so let's look at the outcome, and error if there's a problem
IF @status = 7
    RAISERROR('Package Succeeded',0,0)
ELSE
    IF @status = 9
        RAISERROR('Package completed',0,0)
    ELSE
        IF @status = 3
            RAISERROR('Package Cancelled',16,1)
        ELSE
            IF @status = 4
                RAISERROR('Package failed (see error message above)',16,1)
            ELSE
                IF @status = 6
                    RAISERROR('Package ended unexpectedly',16,1)
                ELSE
                    RAISERROR('Package ended with unknown status %i',16,1,@status)

Similar Messages

  • Windows Server 2008R2 running Remote Desktop Services reports printer process does not exist when installing PDF printer

     Windows Server 2008R2 running Remote Desktop Services reports printer process does not exist when installing PDF printer, And when Installing network printers from the domain controller it reports it cannot connect to printer.  I can ping all
    network devices. I can connect to the internet.
    On boot I get a netlogon 5719 error followed by service control manager errors 7023,7001 and a group policy error 1129.
    Clients can connect to the remote application and RDP operates to connect to the server internally and externally.
    The domain controller is another server 2008r2 box. I have scoured the internet but have not found any solutions that work yet.

    Hi,
    After referring to your post, it can be identified that the issue which you are facing is mostly due to some network issue in your environment. Please recheck your network connection issue between computer and domain controller. 
    Can you able to ping with IP address and also with fully qualified name of a domain controller in the users' and computers' domain. If it fails states that name resolution issue with computer and domain controller. Are you using MS DHCP Relay agent then there’s
    available Hotfix for the particular Event ID. Please go through this KB 2459530 to fix the error event ID.
    As per the net logon error 5719 which you are facing states that the client component of Netlogon was unable to locate a DC for the domain it was trying to perform an operation against. Below is one of the reason. If this is being logged on a DC and the event
    refers to the DC's own domain, something might be preventing the client component of Netlogon from starting a network session (to itself or to another DC in the domain). The following event 7001 & 7023 states start & stop operation service. Please
    go through beneath article for more details.
    1.  Event ID 5719 is logged when you start a computer
    2.  Netlogon 5719 and the Disappearing Domain [Controller]
    3.  Event ID 1129 — Microsoft-Windows-GroupPolicy
    Hope it helps!
    Regards.

  • My airport does not start when pligged in

    My aipport does not start when plugged in.  The light does not come on at all.  If there some kind of a reset switch?

    With no light at all, unfortunately it is likely that an internal component in the AirPort Express has failed.
    The reset switch is next to the audio jack. Try a different AC socket. With the AirPort Express plugged into power, hold in the reset button for 8-10 seconds, then release.
    If successful, the AirPort Express will restart to a solid amber light for 30-35 seconds, then begin to slowly blink amber after 40-45 seconds.
    If you try the reset a few times with no success, I'm afraid that the AirPort Express  has failed and will need to be replaced.

  • Photosmart C6180 on wireless network does not respond when attempting to print

    Photosmart C6180 successfully installed on wireless network does not respond when attempting to print.  All in one is successfully installed on wireless network and SW successfully installed on Windows XP computer yet printer does not print.  Get no error message other than document failed to print.  HELP!

    So gald I'm not the only one. I have been fighting this crappy HP printer for MONTHS also. Everything says a OK goody goody but printer fails to print every two to three weeks.

  • RT does not run when deployed to 9642 sbRIO LV 2011

    I have code deployed to a Ni sbRIO9642 where the RT code does not run when deployed to the when using LabVIEW 2011. It appears the NI-RT.ini file on the target is not being properly configured. I manually configured the ini file using FTP and the RT still will not run. I built a small test application and the RT on that did not run either, although i had hard validatiuon that the FPGA code was indeed running. Thanks - Keith

    Hey Martin, 
    I don't know if this specific problem was resolved, but there was a known issue in LabVIEW Real-Time 2011 (sp1) that exhibited this behavior. 
    Shared Variables
    292012
    Return
    Real-Time Applications containing typedef Shared Variables fail to run.
    If you are building an RTEXE that contains Shared Variables whose data type is based upon a type definition and the build specification is configured to disconnect type definitions the RTEXE will not run.
    Workaround: 1.) Manually disconnect the variable from the typedef before building the application 2.) Change the build spec so it doesn't disconnect type definitions
    Reported Version: 2011 32-bit
    Resolved Version: 2012
    Added: 10/11/2011
    Although this has been fixed in 2012, and shouldn't be an issue for you developing in LabVIEW 2012. Have you tried implementing a heartbeat VI? to verify if your RT app is actually running and not communicating? (great example here)
    Do you have the system state pushier installed on your cRIO? does it point to a memory leak or 100% CPU utilization? (steps to install it found here, if you're not familiar)
    Are you using the cRIO in Scan Interface mode? or in the FPGA interface? 
    Applications Engineer
    National Instruments
    CLD Certified

  • On updating to Yosemite Mail Index damaged but does not  repair when re-opening mail.

    Yosemite updated but Mail index damaged and does not repair when re-opened. How is this fixed?

    I have the same thing happening.  Everything else seems to be working fine, except i can't open my mac mail at all!  it seems to be in a loop and won't let me retrieve any mail or even try to send mail before migrating, but it fails and then its back to the beginning and the same loop continues, so no mac mail working.  I also came from 10.6.8 to 10.10
    jane

  • Busy greeting does not play when I am on another call

    My busy greeting does not play when I am on another call. My regular greeting plays. I called verizon and they gave me some **bleep** about how that feature doesn't work if you have call waiting. It USED to work for me and why do they promote it as a dfeature with their Freedom Essentials package that comes with call waiting? Does anyone know what is going on? I need this feature to work for me.

    Also in the cases of incoming calls or if you place a call and forget to dial *70, in many states you can use 3 way calling to click over and dial *70 to activate Tone Block while on a call. You will hear 3 short confirmation tones and will then be returned to your other call. HOWEVER, do this with care because in some areas there will be a charge for using the 3 way calling if you do not have a monthly subscription to it. In other states Verizon will permit you to use 3 Way solely for the purpose of activating Tone Block without a charge. So check to see what the rules are where you are beforehand.

  • The declared package does not match the expected package

    I was given some Java code that I need to get working and then make some improvements on, but I'm still in the process of learning Java and the IDE Eclipse as well. There is a package called MyGUI and most of the files in that package had the error "The declared package MyGui does not match the expected package MyGUI" as a result of the inconsistent case, so I changed all of the first lines "package MyGui" to "package MyGUI" and this fixed all of those problems except for one.
    There is still one file where it gives this error message even though I changed the code the same way I did for the other files. I can't figure why this file is different. I saved it and I also refreshed everything, but it still gives me the error message "The declared package MyGui does not match the expected package MyGUI" although the package is clearly declared as "MyGUI".
    Does anyone have an idea of why this would be? I am very new to Eclipse and Java, so I don't really know how to go about solving errors yet.

    Forget the IDE until you get a handle on basic concepts like packages and classpath.
    The error you're talking about comes when a .java or .class file is not in a directory that matches its declared package.
    Let's say that CLASSPATH_ROOT is the only element in your classpath. If you have a class that is declared like so:
    package com.foo;
    class Bar {}Then, you must have CLASSPATH_ROOT/com/foo/Bar.java or CLASSPATH_ROOT/com/foo/Bar.class.
    The language rules for .java files are not as strict as those for .class files, but some compilers may expect them to be the same, and it's a good idea to do so even if it's not strictly necessary, for clarity's sake.
    Also, even though Windows' file system is not case sensitive--that is it considers FOO.class and foo.class the same file name--Java is. You probably can't directly rename FOO.java to Foo.java in Windows, as it will say it's the same name, so if you need to change the case, rename it to a different name, than back to Foo with the correct case.
    Edited by: jverd on Mar 29, 2009 12:07 PM

  • Eclipse error : The declared package does not match the expected package

    I'm trying to setup an Eclipse project on some existing code but I can't get past this error. The source files are in the following directories:
    d:\mycompany\coolstuff
    d:\mycompany\neatstuff
    The source files in the coolstuff directory have a package statement:
    package mycompay.coolstuff
    The source files in the neatstuff directory have a package statement:
    package mycompany.neatstuff
    I create a new Eclipse Java project, specify the existing directoy of d:\mycompany. When Eclipse tries to build, it gives the following error:
    The declared package "mycompany.coolstuff" does not match the expected package "coolstuff"
    I've tried everything I can think of short of modifying every package statement since they seem correct based on the Java documentation. What am I missing?

    All the source builds just fine using a command
    nd line and a classpath=.\That's meaningless, since classpath=.\ is just setting the classpath to the current directory.
    d:\mycompany\coolstuff
    d:\mycompany\neatstuff
    The source files in the coolstuff directory have a
    package statement:
    package mycompay.coolstuff
    The source files in the neatstuff directory have a
    package statement:
    package mycompany.neatstuff
    I create a new Eclipse Java project, specify the
    existing directoy of d:\mycompany.When you use the package statement "package mycompay.coolstuff" Eclipse looks in the directory above mycompany for mycompay\coolstuff\<classname>, and that directory is d:\, not d:\mycompany.
    When Eclipse
    tries to build, it gives the following error:
    The declared package "mycompany.coolstuff" does not
    match the expected package "coolstuff"

  • I am experiencing problem (the installation does not start) when I try to install ArchiCAD 17 Educational on my mac. I am using Yosemite. How can I fix it?

    I am experiencing problem (the installation does not start) when I try to install ArchiCAD 17 Educational on my mac. I am using Yosemite. How can I fix it?

    You need to contact the developer/manufacturer directly to determine if their product is compatible w/Yosemite.  It is not listed on their system requirement website:
    Mac OS X 10.9 Mavericks
    Mac OS X 10.8 Mountain Lion
    Mac OS X 10.7 Lion
    Mac OS X 10.6 Snow Leopard*
    Note: ArchiCAD 17 is the last version of ArchiCAD to support Mac OS X 10.6
    Only case insensitive file-system volumes are supported.
    http://www.graphisoft.com/support/system_requirements/archicad17.html

  • Since I installed Lion on my macbook the LED light does not pulse when I close the screen - the sleep function does not work.

    Since I installed Lion on my macbook the LED light does not pulse when I close the screen - the sleep function does not work neither when chosen after pressing the button nor chosen in the apple menu..

    I have had the same problem but on another forum it was suggested that disabling internet sharing would solve this. This fix seems to work on my machine - why it works I do not understand

  • My hp deskjet 1510 series does not print when connected to my hplap top (windows Vista),

    My hp deskjet 1510 series does not print when connected to my hp lap top (windows Vista), it says the printer is not active, although it is default printer, connected and on. However, it does work when connected to the (also HP) lap top (windows 8) of my husband.  I did everything the hp print and scan doctor advised and also what I could find at HP support (like switch of fire walls, reinstall everything, check printpooler ec etc)... it still does nothing except that I managed to print a diagnostic print which should give information about the condition,  but it only gives numbers and letters like : 11. SN = [Edited for Personal Information] Yr  12 PER = 05YR etc, that does not really help me :-). It won't print any testpages.  H E L P!!!

    Hello Elisabeeth,
    Welcome to the HP Forums!
    I understand you're unable to print using the Deskjet 1510. I will do my best to assist you! When you reinstall the HP software, did the installation state it was complete?
    I would start off by following this HP document on 'Printer is offline' Message Displays on the Computer and the Printer Will Not Print. From this document, please make sure you check the connection type and the ports.
    Please post your results, as I will be looking forward to hearing from you.
    I worked on behalf of HP.

  • When I try and play music on my iPhone downloaded from iTunes it says 'this URL is not found on this server'. This does not happen when I play the same music through my iPad. Can anyone help?

    When I try to play music downloaded from itunes on my iPhone 4S it says 'this URL is not found on the server'. This does not happen when I play the same music on my iPad. The music plays fine. The message also comes up when I try and login to iTunes on my iMac. Can anyone help?

    I too am having the same issue as the OP.
    Your USER AGENT information is Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_2) AppleWebKit/600.3.18 (KHTML, like Gecko) Version/8.0.3 Safari/600.3.18
    Every webserver that receives a request from your browser is able to determine the HTTP USER AGENT information unless it has been removed by some software (e.g. firewall) before the request was trasmitted.

  • User gets "This network connection does not exist" when she tries to log on to Terminal Server (2008 R2)

    User gets "This network connection does not exist" when she tryes to log on to Terminal Server (2008 R2)
    I got more than 100 users. Shes the only one getting is. We tried four computers (All Windows 7 Pro)
    Nothing useful in event viewer to mention.

    Hi,
    Thank you for posting in Windows Server Forum.
    Does that user able to login previously?
    From your comment, it seems that there is some permission issue with that user. As you have checked that user with different system also. Please check that user is added under “Remote Desktop User” local group and also allowed “Allow log on through
    Remote Desktop service” permission under group policy. Also please check that when user tries to login it uses “Domainname\Username” format.
    In addition for a try, also check by disabling firewall on one particular system.
    To add users and groups to the Remote Desktop Users group by using Local Users and Groups snap-in:
    1.  Click Start > Administrative Tools, Open Computer Management.
    2.  In the console tree, click the Local Users and Groups node.
    3.  In the details pane, double-click the Groups folder.
    4.  Double-click Remote Desktop Users, and then click
    Add.
    5.  In the Select Users dialog box, click Locations to specify the search location.
    6.  Click Object Types to specify the types of objects you want to search for.
    7.  Type the name you want to add in the Enter the object names to select (examples) box. 
    8.  Click Check Names.
    When the name is located, click OK.
    More information:
    Remote Desktop disconnected or can’t connect to remote computer or to Remote Desktop server (Terminal Server) that is running Windows Server 2008 R2
    http://support.microsoft.com/kb/2477176/en-us
    Hope it helps!
    Thanks,
    Dharmesh

  • I am suddenly unable to open mail from the dock. dock shows mail is up and running, but stamp does not respond when clicked, and will not quit. help?

    I am suddenly unable to open mail from the dock. dock shows mail is up and running, but stamp icon does not respond when clicked, there is no mail window opened, and will not quit. when double clicked, get new mail is not an option and I get no response with other actions.
    I am retrieving mail on my phone with no problem. this just began happening, no updates or problems with anything else.
    help?

    command-option-esc keys and force quit Mail. Then relaunch.

Maybe you are looking for

  • Tecra M4 - tablet function not working

    Hey guys, please excuse my bad english first. I got a Tecra M4 and after installing xp tablet and drivers the tablte still doesn't work. Did I forget a driver? Which one is responsable for the tabletscreen? thx, marti

  • How to create a table in the file using java code.?

    HI, I should export the data from the view objects to a word document. I have done that but I should display the data in the form of a table. Kindly come up with the necessary information on how to create a table in the file using java. Thanks, Phani

  • Auto Stack Freezes Program

    I have a Dual 2.5Ghz G5 with 7GB ram and a Nvidia 6800 Ultra video card - well over the recommended specs in everyway. I am having issues with Autostack being slow (hours) and/or hanging the program. I have tried importing 6900 medium sized jpegs (sh

  • Time out error in UDM_SUPERVISOR

    Hi all, Can anyone suggest what can be done for a timeout error for the transaction UDM_SUPERVISOR. I'm getting this error only for one customer and that too when I'm selecting a date range to view the receivables.

  • HT201210 my i phone 4 wont restore because of an unknown error (21)

    my i phone 4 wont restore because of an unknown error(21)???