Avatar of D B
D BFlag for United States of America

asked on 

SSIS Determine if Running through VS

SSIS has a system property named System::InteractiveMode that BOL states:
Indicates whether the package is run in interactive mode. If a package is running in SSIS Designer, this property is set to True. If a package is running using the DTExec command prompt utility, the property is set to False.
However, this property appears to always be set to False, even when I am in Visual Studio and running the package interactively. I am using VS2019. I have been playing with this for the past couple of hours and it is starting to drive me crazy.
I need to reliably determine whether the package is running interactively or through our batch console using DTEXEC.exe as I need to set some other package variable based on this value..
Has anyone else run into this situation or come up with a way to reliably (without using user variables) determine whether a package is running interactively or via DTExec?
FYI, when just viewing the variables in the designer, it says the value is False. I would expect it to be True by default if I am actually in VS designer.
SSIS

Avatar of undefined
Last Comment
Kyle Abrahams, PMP
Avatar of Kyle Abrahams, PMP
Kyle Abrahams, PMP
Flag of United States of America image

Avatar of D B
D B
Flag of United States of America image

ASKER

Documentation states: The value is changed only if the package is executed by ISServerExec on the Integration Services Server.
This won't work because we are not executing on IS Server. Executing a package via DTExec on the command line does not set this value. Why isn't System::InteractiveMode working?
https://social.msdn.microsoft.com/Forums/sqlserver/en-US/d9ba45ab-9607-43cd-942d-e725434cc9ba/ssis-package-interactive-mode?forum=sqlintegrationservices

Could you use the above from a link with a compiler directive?

eg:

if #debug then
    oPackage.InteractiveMode = true;
#endif 

Open in new window

Avatar of D B
D B
Flag of United States of America image

ASKER

I have been able to come up with an alternate solution. We have a standard initialization sequence container that has a C# script task. One of the things it does is sets a package variable to the contents of the command line.
I can use the value of this variable since it will be empty if executing the package through VS. 
ASKER CERTIFIED SOLUTION
Avatar of D B
D B
Flag of United States of America image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Just a note you can pass in parameters from visual studios as well.  So as long as those Params are exclusive you should be fine, its just not the definitive way to always tell if you are running in vs or command line.
SSIS
SSIS

SQL Server Integration Services (SSIS) is a component of the Microsoft SQL Server database software that can be used to perform a broad range of data migration tasks. SSIS is a platform for data integration and workflow applications. It features a fast and flexible data warehousing tool used for data extraction, transformation, and loading (ETL). The tool may also be used to automate maintenance of SQL Server databases and updates to multidimensional cube data. SSIS replaced Data Transformation Services, which had been a feature of SQL Server since Version 7.0.

3K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo