Triggering stored procedure from script task in SSIS - login failed error - sql

I have a 2008 SSIS package that have a lot of steps, one of the steps is a script task that runs a stored procedure. It is not an option for now to change it from a script task, as it would require a lot of extra developing. The procedure runs fine in the production environment, but I need to be able to test it from VS.
The reason for the failure I have found is that the connection to the target database is not working, it is giving error "Login failed for user 'user'".
The SSIS package is built on a SSIS framework, and it has a "Initialize Connections" task as an Event in the "Initialize" part of the package. I do not know much about what this does. I want to just run the Data Flow (With "Execute task" option inside the Data Flow).
In the ProtectionLevel for the package I have tried both DontSaveSensitive and EncryptSensitiveWithPassword without any luck. I manually insert the password in the Connection Manager.
I read some about the need to use a connection manager/XML file, but I'm unsure of how this can be done. (Not done much SSIS before).
Please explain how this debugging in VS should be done.

Related

Where is the.cs files when a script task is run from the SSISDB using the agent?

I have an SSIS job that contains a script task.
There is also a connection to another server within the package that can only be executed accessed by a specific user and the agent cannot be given read rights to the other server.
So the solution to this is have the SQL job be run as the required user.
The problem with this is this user does not have full control over the folder/file where the script task will be temporarily located while the code runs so I get a failure on the script task but if I run it in visual studio or with the normal agent account the script task executes successfully.
I have tried giving the user access to all major drives on the server but this has not solved the problem
Is the script doing something on the folder?
Or does it just need permission to execute script?
I would anyway advise you to implement error handling in script:
https://learn.microsoft.com/en-us/sql/integration-services/extending-packages-scripting/task/logging-in-the-script-task?view=sql-server-2017
Make sure it works in visual studio, so that when you get that error you are sure that the error is caused by permissions/environment.
You could also take a look at this article:
article

Get SQL queries which are executed from SSIS package on SQL Server

I have built a custom job log framework which logs all of the tasks which are execute in an SSIS package along with any error that surface. Once complete, an enhancement was requested to also store any SQL queries that the SSIS package executes on the SQL Server. This is not limited to only Execute SQL tasks, they are looking for ANY SQL queries that the pack runs. I am aware of the OnInformation logging that is part of the SSIS logging framework, but this only shows some of the query.
Thanks in advance!
These is a free software on codeplex which I believe might satisfy your request at: https://sqlmetadata.codeplex.com/
If you need to code it, you should consider that there are two main types for deployed SSIS packages: Legacy mode and Catalog mode.
Legacy Mode deploys pacakges to msdb where you can find using SELECT name, packagedata FROM msdb.dbo.sysssispackages
Catalog Mode uses SSISDB, you can use catalog.get_project to return project_stream which represents a zip file containing the packages in the project. You can refer to How to export packages deployed in "Integration Services Catalog" using any command line, C# or T-SQL?.
After having the packages' XML, you can easily identify which components you want to export.

SSIS: Working package fails after upgrade to SQL Server 2012

I have a SSIS package that was running fine on SQL2008R2 using Environmental Variables pointing to a configuration file for connection strings. Using VS2010 Shell, I upgraded the package for our SQL Server 2012 database. The package is still in package deployment model. The ProtectionLevel of the package is set to DontSaveSensitive. Run64BitRuntime = False. When I try and execute the package in VS, I am getting the following errors:
[OLE DB Destination [2]] Error: SSIS Error Code DTS_E_CANNOTACQUIRECONNECTIONFROMCONNECTIONMANAGER. The AcquireConnection method call to the connection manager "DB_Connection" failed with error code 0xC0202009. There may be error messages posted before this with more information on why the AcquireConnection method call failed.**
[SSIS.Pipeline] Error: OLE DB Destination failed the pre-execute phase and returned error code 0xC020801C.**
With full logging on, I see the first failure here:
Diagnostic,[ComputerName],OFFICE\username,DB_Connection,{5AD75239-D546-4AAF-963E-E195FC2F0C1E},{9EC48106-DDBD-40E9-8FBB-942BCF025EEE},3/26/2013 10:35:21 AM,3/26/2013 10:35:21 AM,0,(null),ExternalRequest_post: 'ITransactionJoin::JoinTransaction failed'. The external request has completed.**
The part that is really throwing me is that earlier in the package, the same "DB_Connection" manager is used successfully in a number of Execute SQL Tasks. So, it seems the connection strings are being read from the configurations correctly.
I have tried deleting\recreating the Connection Manager. I have verified that DTC is configured properly on both my local and the server. I have other packages connecting to the same SQL2012 DB using the same configuration method using Data Flow Tasks without a problem.
Any help anyone can give to point me in the right direction will be much appreciated. I would prefer to not have to move to a project deployment model at this time if I do not have to.
I was able to get my package to run locally. While I had checked the TransactionOption on my tasks to make sure they were set to Supported, it turned out that one of my sequence containers was set to Required. Not sure why this worked in SQL2008R2, but not in SQL2012. I changed my container to Supported and the package runs now.

ssis job in sql server agent

I created an SSIS package, which runs fine in Sql Server Business Intelligence. The problem is when I try to schedule a job to run, I tested it and it says the exe does not exist in the directory and it lists the path to the directory where the exe is located. The exe is obviously there, and the exe runs fine, it just doesn't like the package when I try to schedule a job.
The error that I can see in the job activity monitor is
Description: File/Process "FileName.exe" does not exist in the directory "DirectoryName" End Error
Anybody know how to fix this?
An SSIS package is not an EXE. The name is typically something like 'MyPackageName.dtsx'. The package is interpreted & executed by the DTS utility running in conjunction with a SQL Server instance.
We use SQL Agent to run SSIS packages as a standard part of our application, so that itself shouldn't be a problem. How do you have your SQL Agent job defined?

Troubleshoot SSIS issues

I'm trouble shooting an SSIS package that is failing. When I execute the package it runs 1st step but fails at the second step with the message "Execution of the job "XXXX" failed. See history log for details, history log has very little information there. Is there a way to see an exact error or generate log file with meaningful information?
Thanks!
You should modify Logging in the package so that it logs all possible things and rerun the package to see where it is failing.
But before that, you should back up the package so that you can recover from mishaps.