SSIS package tasks copy paste and keep connection manager name - ssis

I have some larger SSIS package processes I wrote in a test package and I want to copy/past it into an existing package. I have connection managers in both packages that have the same name. When I copy from one package to the other, it creates a new connection manager but with a "1" at the end of it.
Is there a way to have it NOT do this and just use the existing package connection manager with the same name?
Otherwise I will have to go into all the tasks, update the connection manager, and in places it resets the tables I was inserting into and I will have to redo all that as well.
Any suggestions?
Also is there anyway to update a variable name in many tasks easily? I just want to rename a variable but dont want to have to go in and edit every task to do so.

You can use a project level connection manager instead of using package level connection manager.
Right click on Connection Manager in solution explorer and create the connection manager. This connection manager will be common to all the packages. You can change the tables for this connection manager where you are using it. For all packages it will point to same database.
As you can see in below snapshot PackageLevel_ConManager is not visible, but Project level is visible in both the snapshot.

Related

When do SSIS Connections occur?

Do SSIS ConnectionManagers attempt to make their connections on package start, or when the connection is first used?
If it's the latter, I can use failure transitions to handle connection failures within the package, but if it's the former then I have to do it externally.
I can assume that they'd design it with the latter, but I can't find it in the documentation anywhere easily searchable/accessible.
It depends and can be controlled.
With the default setting of DelayValidation=false property, SSIS engine at package start tries to connect (validate) all Connection Managers and tasks with metadata and which use Connection Managers like Data Flows etc.
If you set DelayValidation=true on the Connection Manager itself and all relevant tasks, then the first connection on the Connection Manager for the validation would be executed right before the task is executed. This is quite helpful if you use expressions on Connection Manager properties, like dynamic connection string, and before package execution it cannot be evaluated.
In SSIS,it always try to validate connection manager at the package start time.
Once the SSIS package start, it first validate for all parameter, variable and connection manager etc.

Connection manager in SSIS pointing to incorrect database

I am building a SSIS package using SSDT 2015. I have created two connection managers. One pointing to A database and other to B database. The second manager connection manager seems loosing the reference to the database every time i open the solution. It points to A instead of B. I am saving every time but it doesn't seem to remember the save.
Has anybody faced this issue ?
Properties window of the connection manager
Expressions editor

Description: component "MyDataFlowOLEDBSourceComponent" (10250) failed the pre-execute phase and returned error code 0xC0202009

I have an SSIS package that has run for months daily with no problem. Suddenly it is failing every day with the error above. No changes to the package or the stored procs it runs have been pushed, to my knowledge, no changes to the database environment have been made including permissions for the service account that owns the job.
This is a SQL Server 2008 package that connects to a SQL server 2008 R2 database. The configuration is through the ssisconfig table and it defines which server to use through an environment variable.
The component in question is using a stored proc. In the proc, all fields are explicitly cast to the same data type of the table the data is being staged too. The proc runs fine by itself. It is a relatively complex proc that has two table variables and a CTE.
I can't run it from my local on prod and dev is not failing. If I open the prod SSIS package while I am set to the environment variable that the job owner uses, I do not get a validation error on this component. ValidateExternalMetadata is set to true for this component. For the entire package though, Delay Validation is set to True. I do get a validation error that would be expected on a task using a variable that is set dynamically in an earlier task. This error, however, is many, many steps later than the step it is currently failing on.
Usually in the past when we have had this sort of unspecific error, I have been easily able to see the problem with the data that caused the sudden failure. But none of the data in the proc result set is even close to being incorrect for the datatypes defined for staging table for that field. None of the required fields are missing data either.
I am out of ideas for what else to look at. If the environment didn't change, the actual code didn't change and the data looks correct, what is left to try?
As I have commented for details error, you can try below link from Microsoft:
Debug SSIS Package while calling from Agent
Some info from link:
Reasons that the package may have failed are as follows:
The user account that is used to run the package under SQL Server Agent differs from the original package author.
The user account does not have the required permissions to make connections or to access resources outside the SSIS package.
The package may not run in the following scenarios:
The current user cannot decrypt secrets from the package. This scenario can occur if the current account or the execution account
differs from the original package author, and the package's
ProtectionLevel property setting does not let the current user
decrypt secrets in the package.
A SQL Server connection that uses integrated security fails because the current user does not have the required permissions.
File access fails because the current user does not have the required permissions to write to the file share that the connection
manager accesses. For example, this scenario can occur with text
log providers that do not use a login and a password. This scenario
can also occur with any task that depends on the file connection
manager, such as a SSIS file system task.
A registry-based SSIS package configuration uses the HKEY_CURRENT_USER registry keys. The HKEY_CURRENT_USER registry keys
are user-specific.
A task or a connection manager requires that the current user account has correct permissions.
Method 1: Use a SQL Server Agent proxy account Create a SQL Server Agent proxy account. This proxy account must use a credential that
lets SQL Server Agent run the job as the account that created the
package or as an account that has the required permissions.
This method works to decrypt secrets and satisfies the key
requirements by user. However, this method may have limited success
because the SSIS package user keys involve the current user and the
current computer. Therefore, if you move the package to another
computer, this method may still fail, even if the job step uses the
correct proxy account.
Method 2: Set the SSIS Package ProtectionLevel property to ServerStorage Change the SSIS Package ProtectionLevel property to
ServerStorage. This setting stores the package in a SQL Server
database and allows for access control through SQL Server database
roles.
Method 3: Set the SSIS Package ProtectionLevel property to EncryptSensitiveWithPassword Change the SSIS Package ProtectionLevel
property to EncryptSensitiveWithPassword. This setting uses a password
for encryption. You can then modify the SQL Server Agent job step
command line to include this password.
Method 4: Use SSIS Package configuration files Use SSIS Package configuration files to store sensitive information, and then store
these configuration files in a secured folder. You can then change the
ProtectionLevel property to DontSaveSensitive so that the package is
not encrypted and does not try to save secrets to the package. When
you run the SSIS package, the required information is loaded from the
configuration file. Make sure that the configuration files are
adequately protected if they contain sensitive information.
Method 5: Create a package template For a long-term resolution, create a package template that uses a protection level that differs
from the default setting. This problem will not occur in future
packages.
Above link will help you through logging and other possible scenarios of failure of your package from SQL Agent. I suspect that your user of Agent has been corrupted. But that is an assumption. You first enable the logging of SSIS by following link :
Enable SSIS Package Logging
Some info from link
To set the logging level for a package by using the Execute Package
dialog box
In SQL Server Management Studio, navigate to the package in Object Explorer.
Right-click the package and select Execute.
Select the Advanced tab in the Execute Package dialog box.
Under Logging level, select the logging level. See the table below for a description of available values.
Complete any other package configurations, then click OK to run the package.
Hope this will help you in the first place. If not please let me know.

SSIS: Do package data sources update all connected connection managers automatically?

I converted a big project from SSIS2008 -> SSIS2014
During conversion i also erased all connection managers and recreated them based on the packages data sources.
Now i want to test my packages on another server , so i changed my 2 data sources only.
When i open the packages can see on the connection-string the old server.
If i dont do anything else and press start, what will happen?
Will the package update itself automatically and get the connection string of the data source or not?
If it doesn't then what is the point to have the option "create connenction manager from data source" and assign a DataSourceID to the package connection manager?
I am in package deployment model.

SSIS 2012: Package fails from SQL Agent but runs OK manually

There is a Master package as below to call and run all child packages in my SSIS solution by Project Reference. Also, all connection managers are set at project level since all packages are sharing the same ones.
When manually running, everything works well from master to last child. However, when the master package is executed from a SQL Agent, it shows error as follows:
Code: 0xC001000E Source: Master
Description: The connection "{5A827D76-916C-4F22-ADE9-266ABBEB1E37}" is not found.
This error is thrown by Connections collection when the specific connection element is not found.
Then I checked the connection ID and found it is an OLE DB connection manager in the first child package as follows:
I'm not sure if I should replace project connections with package level to fix this issue. Hopefully someone could help me out. Thanks in advance!
Some more info that might be helpful:
All connection managers are connect to SQL-Server 2012 and my visual studio version is 2010.
An SSIS proxy is created with the same windows account of packages for SQL Agent to execute. It also has full control to all DBs used in solution.
SQL Agent is set as below: