How to use Environment File in SSIS Job Step Property - sql-server

Created a package and deployed on SQL Server 2017. my package is having parameters (package level scope) and want to set values from environment file at the time of create a SQL-JOB-STEP.
I have created environment file and defined my variables perfectly "Integration Services Categolog => SSISDB => MyProject => Environments" and those variables can be assigned at the time of configure & execute to my package parameters which is working well.
but I cannot do the same while create SQL-JOB. I can see in "step properties window" there is a option to locate "Environment" file but when I locate the file then I cannot find the way to assign those variables to my package's parameters. can anyone help me in this please?
please refer picture:

Click the ellipses (...) besides the empty Value spot. There you will be presented with three options (if you didn't have an Environment established, there'd be only two).
The design time value is the default here. If your parameter, MyVar01_PackageLevel, had an actual value displayed, the UI would render it in the default font weight/style.
One row above is a manual override radio button and here you can just hard code the value. Doing this will result in the Value displayed to be in bold
One row below the design time value is where you can associate a parameter to a list of parameter values from your Environment. Scroll through the list of values, which are in no discernible order, and find the target property name. Let's call it V01_PL After selecting that, the above will indicate V01_PL in an italicized font. It won't show the value of V01_PL mind you, it'll just tell you it's driven the configured value.

Related

Adding a edit field in a custom dialog in Installshield

I have a setup project with Installshield Premium 2016.
I created a custom dialog that has a edit field. I created a property name which was named "CustomFields" and In my appconfig there is a key
<add key="customFields" value="Test"></add>
So while installing the app, I want to it to change the value of customFields by user. My property value has a default name that is Test and in the installation dialog I can see this name
When I change this text by manually for example "Hello", after installation completed, in my appconfig i see "Test" value. It seems that it saves the default value. But as can be seen, the text field has referenced by this property thats why I can see the default value in my text field in the dialog.
I do not know where is the problem? I could not find also any documentation about custom edit fields.
I followed here a bit https://www.iwasdot.com/adding-a-custom-dialog-to-and-installshield-basic-msi-project/
but its a bit different and it did not work to me
Private properties are not passed from the UI sequence to the execute sequence. If you want this to work, at a minumum you will have to rename your property to use only upper-case letters and underscores. (For example, change CustomFields to CUSTOM_FIELDS.) You may also have to include its name in the SecureCustomProperties property.
I followed #Michae's answer but still not worked. So I changed next pushbutton property and it worked finally..

How do you specify the SQLite database file in FireDAC's TFDPhysSQLiteDriverLink component?

I'm trying to modify one of the FireDAC sample projects in order to use an existing SQLite file as the database source. The sample works fine unmodified and connects to its database. However, I can't figure out where the database it connects to is specified, in order to change it.
According to the documentation, there should be a Database property on the TFDPhysSQLiteDriverLink component. There isn't: it doesn't exist. I even converted the form to text and looked through all components' customized properties, and there's no path defined anywhere. Nor is there in code - the sample is very small and there's no path defined at all.
The other option on the documentation is to include the FireDAC.Phys.SQLite unit, although that doesn't explain how to set the database, since as far as I can tell that unit just includes the component. And when I search for Database properties (see attached image) none of them in any class in that unit seem to be quite what I'm after. The closest is a string that's for a backup component - I doubt that's what I need. There is a SQLiteDatabase property in the TFDPhysSQLiteConnection class but that's read-only.
List of all Database properties defined in the FireDAC.Phys.SQLite unit
I also tried creating a temporary connection definition at runtime, by double-clicking the TFDConnection component. That only gives an exception:
Exception double-clicking the TFDConnection component
The only solution to this I found is in the XE5 documentation, where it says to set the $(PUBLICDOCUMENTSDIR) environment variable. I already had to do that to get the demo to run (previously, it threw the same exception on the line FDConnection1.Connected := True;; it doesn't now, the demo runs perfectly at runtime.) That change obviously hasn't affected the designer, and I don't even know if I'm looking in the right place, since after all the documentation talks about setting the Database property.
So I'm stumped. Where does it set the database? It's not in the DFM or any streamed properties; it's not in the property defined by the documentation (TFDPhysSQLiteDriverLink.Database doesn't exist, nor does anything that looks like it); it's not in the TFDConnection designtime editor (even though it throws an exception, a file specified as a property here would appear in the streamed DFM, I'd think); it's not in code; ...where else can it be?
(I have never used FireDAC before so am a complete noob, btw. I'm self-teaching via the documentation and samples.)
You don't actually need a TFDPhysSQLiteDriverLink for a minimalist FireDAC project, and using one rather confuses the issue if you're trying to make a connection to a database for the first time.
Try this:
Make a note of the name including path of a Sqlite db.
Start a new VCL project and drop a TFDconnection, TFDQuery, TDataSource & TDBGrid onto its form and connection them up. Set the TDFQuery's Sql to select * from some table you know exists in the db.
Right-click the TFDConnection and select Connection editor from the pop-up.
Set the DriverID to SQLite and insert your db name into the Database Value box.
Open the FDQuery.
If you compile and run the project, you'll get an exception telling you a class factory for a TFDGUIxWaitCursor is missing (this is the sort of thing I love about FireDAC), but that's easily fixed by dropping one onto your form. Notice that you don't have to connect it using the Object Inspector to any of the other FD components.
After that, you can add a TFDPhysSQLiteDriverLink and set its DriverID to the same as for the TFDConnection.
I ussualy roll my own class and handle the OnBeforeConnect event
Something like this
procedure TSQLiteConnection.SQLiteConnectionBeforeConnect(Sender: TObject);
begin
if not(TFile.Exists(DatabaseFilePath)) then
Params.Values['OpenMode'] := 'CreateUTF16'
else
Params.Values['OpenMode'] := 'ReadWrite';
Params.Values['Database'] := DatabaseFilePath;
DriverName := 'SQLite';
end;
The DatabaseFilePath is just a string field of the class, so basically you can put any file path there
TSQLiteConnection is, of course, a TFDConnection descendant

variable stuck in SSIS package

I am writing my first SSIS package to translate data from an SQL View to a flat text file.
The flat text filename needs to be in the date format "[year][month][day][hour][minute][second][ms].txt".
I have added a script component to generate this name which stores it to a variable #[User::Filename] correctly.
Somehow during fiddling with the Script Task the ReadWriteVariables property has been set to the result of the Script (eg. "20130524140500297").
I have tried removing this setting in the property window of the Task and by editing the task:
This seems to 'take' but when I build the package the setting magically reverts to the useless number!
Is there something I am missing or any way to remove this permanently?
I don't want to revert the file to an earlier version.
Yes, you're missing the fact, that ReadWriteVariables property in Script Component should have a list of variables that you want to modify in your script. You however set it to evaluate as expression :).
To correct this, set ReadWriteVariables to #[User::Filename], mark EvaluateAsExpression property of #[User::Filename], and set the expression to the variable, not the script.
edit: evaluate variable as expression location:

SSIS package configuration parent variable not being passed

I am testing two simple packages in a project in SSIS 2008. I have parent package with a variable and I would like pass that variable down to the child package called from parent using an Execute Package Task. I am using Package Configurations choosing the Parent Package Variable option. However, the child package is not picking up the variable. I have checked the config over and over and the variable names are exactly the same (I know it is case sensetive). Any ideas?
this is the process I've used and have had great results.
First make sure you're editing the package configuration of your child package, and the variable exists in both your parent and child package.
Then in the package configuration wizard at "Select Configuration Type" Make sure configuration type is set to "Parent Package Variable" and that the text you enter into "Parent variable:" matches the name of the variable in parent package exactly. Should look like User::Var1. Hit next
On the "Select Target Property" screen, under your child package, in variables select the variable you want the data to go into, open that variables properties, then select the Value property. This is where the value of the parent variable is going to go.
in this example
child -> Variables -> Var1 -> Properties -> Value
hit next
Give this config a name and hit finish.
hope this helped.

How to start the associated program when selecting more than one files?

I have set .jpg file associated to my own program. I want to add the context menu to .jpg files, so I set the entry of HKCR.jpg\shell\open\command to "myProg.exe %1". After associating, there will be an item on the top of the context menu saying "Open image with myprog". This works right when I select a single .jpg file, but when I selected more than one file and click the top item of the context menu, nothing happended. How can I solve the problem?
Thank you very much
Each selected file will be sent to a new instance of your application. Your application should check if a previous version exists, or not. If a previous instance exists, it should sent its parameters to it (e.g. using Windows Messages) and then terminate.
Another approach is to use DDE (Dynamic Data Exchange), an old method used by Shell to send all files to one instance of your program.
You might need double quotes around the "%1".
Read this article for much more detailed information about how all this works.
http://msdn.microsoft.com/en-us/library/bb776883.aspx
Also, this blog entry talks about what you need to do specifically for multi-select command execution: http://blogs.msdn.com/pix/archive/2006/06/30/652889.aspx

Resources