Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why does my ODBC connection fail when running an SSIS load in Visual Studio but not when running the same package using Execute Package Utility

Tags:

I'm working on a Data Mart loading package in SSIS 2012. When attempting to execute the package in Visual Studio I get this error:

"The AcquireConnection method call to the connection manager Data Warehouse.ssusr failed with error code 0xC0014009".

When I test the connectivity of the Connection Manager Data Warehouse.ssusr I see that it passes.

When I execute the package outside of Visual Studio using the Execute Package Utility, the package runs.

I don't understand what's going on.

The package also refuses to run using the SQL Server Job Schedule, if that has anything to do with anything.

like image 721
Scott Wood Avatar asked Dec 19 '12 00:12

Scott Wood


People also ask

Why is my SSIS package failing?

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.

Is ODBC supported by Visual Studio?

Visual Studio also supports creating ODBC data source connections visually: Create a data connection in Server Explorer and drag it onto a form or design surface. Configure the OdbcConnection object that appears in the component tray.


1 Answers

Making some assumptions here, but I'm going to assume that this is a 32 vs 64 bit issue. To verify, try these two commands from a command prompt (Windows Key, R, cmd.exe or Start, Run, cmd.exe)

"C:\Program Files (x86)\Microsoft SQL Server\110\DTS\Binn\dtexec.exe" /file C:\myPackage.dtsx "C:\Program Files\Microsoft SQL Server\110\DTS\Binn\dtexec.exe" /file C:\myPackage.dtsx 

The first will run your package in 32 bit mode whilst the second runs it in 64 bit mode. This is going to matter as your drivers and any DSNs you've created are going to only be visible in the 32/64 bit world.

Fixing SSDT

Once you've identified which one you need, probably 32 bit version, you'd need to ensure your project is using the appropriate run-time. Right click on your project and select Properties and then navigate to the Debugging tab under the Configuration Properties.

Debugging Tab, Run64BitRuntime

After inverting the Run64BitRuntime value, I assume your package will work from within SSDT.

Fixing SQL Agent

You will need to edit the existing SQL Agent job to change the bittedness of the job step. This will be under the Configuration tab and then under the Advanced tab. Check/Uncheck the 32-bit runtime.

agent 32bit tab

Lies and deception

Observant folks may see that the dtexec offers a /X86 option. Don't believe it. The only way to get the correct bit-ness is to explicitly call the correct dtexec.exe The documentation even says as much but nobody reads documentation.

This option is only used by SQL Server Agent. This option is ignored if you run the dtexec utility at the command prompt.

like image 154
billinkc Avatar answered Sep 23 '22 06:09

billinkc