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

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.

Leave a Comment