SSIS Configuration problem: not returning SQL Server Table config values - configuration

This was posted on server fault, but in retrospect that may not be the best spot for it, so I've moved it here.
I have a package that runs fine on my dev machine but in production (and also on another dev desktop) the Config seems to stop working. I'm using SQL Server Table configuration to pull a value from a table and populate a variable. My Database connection string is passed in at runtime so this should be taken care of in the production environment. There are no errors, but the value is not retrieved and the variable remains blank (it is actually a path, so I get a file not found as the path is blank).
The package works on my machine. It retrieves the correct path from the table and populates the variable as expected. Why this stops working with no error elsewhere is a mystery. Is there someplace that configuration needs to be 'switched on', apart from the checkbox on the front page of the config wizard.

Try Event Handlers
1. Select Event Handler OnVariableValueChanged
2. Add a script task to the pane
3. Pass in System::VariableName,System::VariableValue as InputVariables
4. Add the following to the code:
Public Sub Main()
Dts.Events.FireInformation(0, "VariableChangedEventLog", "Variable " & Dts.Variables("System::VariableName").Value.ToString() & " Changed to:- " & Dts.Variables("System::VariableValue").Value.ToString(), "", 0, True)
Dts.TaskResult = Dts.Results.Success
End Sub
This will print out the variables and will at least give you an indication of whether the correct values are passed into the package.
I have the problem that my package receives the correct configuration file, but then is not passing this value onto my child packages. May well post a link to a new post on this.

Related

Exported a modified Report from dev to test. Now report complains about missing parameter values

I've updated a report (Data provider based) to include new parameters. The report runs perfectly on the dev environment so I exported it via XPO to the test environment (including all tables and classes). Now when I try to run the report I'm getting a slew of errors stating that parameter X is missing a value.
I know how to fix these. The problem is that one of them is my newly added parameter which I've confirmed via debugging is assigned a value.
Even after multiple:
Forward and CIL compiles
Cache clearings
Re-deploys
Re-imports
Service restarts
the problem persists.
UPDATE: I've tried a Full Build + Full CIL Compile as well. Clearing the XPPIL folder and doing another full build + full cil isn't an option at the moment. So I've gone and set all the parameters to "AllowEmpty" and "Nullable" which does get rid of the error messages. But the core problem persists as I have expected: The parameter I added is not receiving the value from the contract.

DTS Package unable to edit parameters

I have a DTS package where I am getting a very odd problem.
If I open the solution, when I look at a package, I can view and edit the parameter list.
If I open the same file, just as a standalone file, then although I can see everything else. The parameter list comes back blank.
Does anyone have a solution?
Some extra information as per request.
If I open the file directly within Visual Studio (2012 in this case) and view the parameter list, I get the following:
When I open the same file as part of a project, I get the following:
No errors are reported, but when I open the file stand alone I can no longer see the parameters.
Ok so it seems you want to edit the design time values of a package's parameters outside of the context of an SSIS project. As noted with your screen shots, if you open an SSIS package that has package parameters in it, they are not displayed. You get the same behavior if you click on the Parameter tab for an SSIS project that is using the classic Package deployment model.
This appears to be by design but you're welcome to open a Connect item to see if the product team will change this behaviour.
In the mean time, I see two approaches. The first is to hand edit the XML. Right click, view code and you'll find a section like the following. Change the value of your ParameterValue section and you'll be right as rain. The most important thing of course is that prior to mucking about with XML is to ensure you have a known, safe, recoverable version of the package - preferably in some sort of version control.
<DTS:PackageParameters>
<DTS:PackageParameter
DTS:CreationName=""
DTS:DataType="3"
DTS:DTSID="{C6988EC3-F273-4889-83B8-02A4AC8F6E9A}"
DTS:ObjectName="MyParameter">
<DTS:Property
DTS:DataType="3"
DTS:Name="ParameterValue">0</DTS:Property>
</DTS:PackageParameter>
</DTS:PackageParameters>
A different approach, and one that I would likely employ is to not care about what the package has as a value on disk. Instead, I'd focus on the value after deployment.
Consider the following code, it applies a configuration in the SSISDB that ensures the value of MyParamter is always 1. At rest, the value is 0 but by applying a configuration, I know that when this package runs in the catalog, it's going to use the configured value and not the design-time value. This approach is also generally going to be more accepted in places that are subject to change controls like SOX/SAS70/HIPPA/PCI etc
DECLARE #var int = 1;
EXEC SSISDB.catalog.set_object_parameter_value
#object_type = 30
, #parameter_name = N'MyParameter'
, #object_name = N'Package.dtsx'
, #folder_name = N'Deploy'
, #project_name = N'SO_ProjectDeploymentModel'
, #value_type = V
, #parameter_value = #var;

SSIS parametrize connection strings

I am trying to set up deployment process for single package usinig project deployment so VS2012. I found that to change dynamicaly connection string on the server I can parametrize connections so I did this and created enviroments and I run my package with inviroment which has connnections strings as parameters and all seems to be fine, but why on connection manager I can still see some old setup made while developing? How can I remove it ?
By Parameterize, I assume you're using the Configuration section to globally configure a project/package or on a per-execution basis. This is in contrast to using project/package Parameters
I have created an SSIS Environment variable named ConnectionStrings in my deployment folder and it has two values: ServerName and CatalogName.
I right clicked on my project, DeployMe, and selected Configure. In your screenshot, you have clicked on the specific package and selected Configure. That or you manually changed the Scope drop down.
I first click on the References and add a pointer to my Environment
Back to the Parameters tab, I click over to Connection Managers and I'm going to configure the CM_Project connection manager's ServerName property to use my environment variable's ServerName value. Clear right?
After configuring the ServerName, I also configured the InitialCatalog property but instead of using my Environment Variable's value, I used the "Edit Value" option (above) to set it. The net result is that my properties now look like this.
The underscore indicates it's set from an environment variable
The bold text indicates it's set manually.
Now when I go to run my package, via Agent or manual execution, the first thing it's going to prompt me for is an environment reference. I've lost my bolding for the InitialCatalog but the underlining remains for ServerName property. None-the-less, both are different values and were I to execute it, they would pick up the correct values.
All that said, I find it far easier to just store the whole ConnectionString value. You will observe, if you take this route, that the values displayed for ServerName would show your design-time values but that's fine because the ConnectionString as a whole will override the individual values at run-time.
I know this is a generic answer but I'm hoping I've hit on what you're missing step-wise.

SSIS Execute Package task notification if path does not exist

I have created a master control package that calls several packages using the execute package task control. I have set all the package file locations to use a sql config table which contains the file location and then used an expression to include the package name. Everything works as expected however I want to include some handlers to notify me if the package location does not exist (just in case somebody changes the path in the config table). To test I set an incorrect file name in one of the expressions which turned the execute package task control red as expected however I can't figure out how to add the notification task. I have tried all the error handler events assocaited with it but no joy plus I added a mail task to the task in question for failure and this did not execute!
Any advice greatly appreciated.
Thanks.
That's why you have OnError event handler, just configure it properly. Are you sure, you're checking Event Handlers for the package and not for one of the blocks inside?
There's a plenty of system variables with OnError scope. Check grey x in Variable window to see them. You might want to use:
- ErrorDescription
- ErrorCode
- SourceName
but choose them according to the report format.
Now in event handler create a script which will put a message into a new variable, and finally send it with send mail task.

SSIS Package OnError Logging

I have an SSIS Package with two steps:
1) FTP in to a server and download a file to the local SQL Server
2) Execute a SQL Satatement, that fires a Storeed Procedure.
Both of these steps work fine, however, I would like to log the success or failure of these steps, so in the system this is for, add a grid with the status (success or failure) of each SSIS Package that runs for that day.
To do this, I have set up an Event handler for the FTP step and added an "Execute SQL Task" to the handler. This uses the "SqlStatementSource" property within Property Expressions, and an insert statement that inserts the system::variables such as System::ErrorCode, System::ErrorDescription.
When I test the expression with the "Evaluate Expression" button, everything is fine. But when I try to test the event by using a wrong password in the FTP connection, the FTP step fails, but the event handler is not raised even though the event handler type is set to OnError.
Any ideas?
Thanks in advance!
What you did seems good, there shouldn't be any problem with that.
Make sure you add the error handler at package level i.e. the top level.
I did the same today, in my case, I was exporting my data to a flat file on local drive
and was using a variable for FilePath.
I used the OnError event handler too.
To check that its working fine or not, I changed the FilePath variable to "Z:\" (which doesnt exists on my system).
and I got the error in OnError event handler like
-1073450982 component "Flat File Destination" (63) failed the pre-execute phase and returned error code 0xC020200E.
-1071636466 Cannot open the datafile "Z:\COM_10212009.txt".
Hope this helps.