Batch file executes SSIS package successfully when done manually, but fails when it's executed with Windows Task Scheduler

1

I have a batch file that executes a SSIS package, this SSIS package gets data from an Access data base in a server(z: unit). Then passes the data to a SQL Server. When I execute the batch file manually (double click) or on the command line it works fine.

But I want this batch file to be scheduled in the Task Scheduler of Windows 7. I can create the task but when it's executed with the task scheduler it fails. My batch file is the following:

DTEXEC /FILE "F:\Projects\Complains\SSIS Complains\Get_Complains.dtsx" /DECRYPT XXXXX /CHECKPOINTING OFF  /REPORTING EWCDI >F:\Logs\Log_Get_Complains.txt

And the error message I get is the following:

Utilidad de ejecuci¢n de paquetes de Microsoft (R) SQL Server Versi¢n 10.0.1600.22 para 32 bits Copyright (C) Microsoft Corp 1984-2005. Reservados todos los derechos.

Iniciado: 09:37:29 a.m. Informaci¢n: 2014-06-06 09:37:29.48 C¢digo: 0x4004300A Origen: Tarea Flujo de datos SSIS.Pipeline
Descripci¢n: Se est  iniciando la fase de validaci¢n. Fin de informaci¢n Error: 2014-06-06 09:37:30.25 C¢digo: 0xC0047062
Origen: Tarea Flujo de datos Origen de ADO NET 1 [1433]
Descripci¢n: System.Data.Odbc.OdbcException: ERROR [HY024] [Microsoft][Controlador ODBC Microsoft Access] '(desconocido)' no es una ruta de acceso v lida. Aseg£rese de que la ruta est  escrita correctamente y que est  conectado al servidor donde se encuentra el archivo. ERROR [IM006] [Microsoft][Administrador de controladores ODBC] Error de SQLSetConnectAttr del controlador ERROR [HY024] [Microsoft][Controlador ODBC Microsoft Access] '(desconocido)' no es una ruta de acceso v lida. Aseg£rese de que la ruta est  escrita correctamente y que est  conectado al servidor donde se encuentra el archivo. en System.Data.Odbc.OdbcConnection.HandleError(OdbcHandle hrHandle, RetCode retcode) en System.Data.Odbc.OdbcConnectionHandle..ctor(OdbcConnection connection, OdbcConnectionString constr, OdbcEnvironmentHandle environmentHandle) en System.Data.Odbc.OdbcConnectionOpen..ctor(OdbcConnection outerConnection, OdbcConnectionString connectionOptions) en System.Data.Odbc.OdbcConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningObject) en System.Data.ProviderBase.DbConnectionFactory.CreateNonPooledConnection(DbConnection owningConnection, DbConnectionPoolGroup poolGroup) en System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection) en System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) en System.Data.Odbc.OdbcConnection.Open() en Microsoft.SqlServer.Dts.Runtime.ManagedHelper.GetManagedConnection(String assemblyQualifiedName, String connStr, Object transaction) en Microsoft.SqlServer.Dts.Runtime.Wrapper.IDTSConnectionManager100.AcquireConnection(Object pTransaction) en Microsoft.SqlServer.Dts.Pipeline.DataReaderSourceAdapter.AcquireConnections(Object transaction) en Microsoft.SqlServer.Dts.Pipeline.ManagedComponentHost.HostAcquireConnections(IDTSManagedComponentWrapper100 wrapper, Object transaction) Fin de error Error: 2014-06-06 09:37:30.25 C¢digo: 0xC0047017 Origen: Tarea Flujo de datos SSIS.Pipeline Descripci¢n: Error en la validaci¢n de componente "Origen de ADO NET 1" (1433); se devolvi¢ el c¢digo de error 0x80131937. Fin de error Error: 2014-06-06 09:37:30.25 C¢digo: 0xC004700C Origen: Tarea Flujo de datos SSIS.Pipeline
Descripci¢n: Error al validar uno o m s componentes. Fin de error Error: 2014-06-06 09:37:30.25 C¢digo: 0xC0024107 Origen: Tarea Flujo de datos Descripci¢n: Se produjeron errores al validar la tarea. Fin de error DTExec: la ejecuci¢n del paquete devolvi¢ DTSER_FAILURE (1). Iniciado: 09:37:29 a.m. Finalizado: 09:37:30 a.m. Transcurrido: 1.077 segundos

I know it's in Spanish, but I hope that won't be a problem.

I know the error pretty much explains itself, it can't find or connect to the Access ODBC because it can't validate it according to the first code of error:

0x4004300A

I've already checked the Microsoft Support Page for this code of error, and changed the ValidateExternalMetadata property to False but it didn't do anything. and the other errors are derivative from the first one.

I've already checked the ODBCs in the ODBC data source administrator(odbcad32.exe) to see if the Drivers are in System DSN and they are, there are not drivers in User DSN, I've also checked if they are 32 bit and they are, everything here runs ant 32. So, from what I understand, there shouldn't be any permission problems, since all the ODBCs are in System DSN.

In Task Scheduler I created the task to run as SYSTEM, all of our tasks in the scheduler are run as SYSTEM, and gave it the highest privileges.

So if anyone could help me, I'll appreciate it.

sql
sql-server
batch-file
ssis
scheduled-tasks
asked on Stack Overflow Jun 6, 2014 by user1704874 • edited Jun 6, 2014 by marc_s

1 Answer

1

I'd wager you are relying on windows credentials in a connection manager, which are available when running it manually, but not when the task scheduler runs it.

You might be better served deploying the package to SQL Server and running a SQL Job, I'm not sure of a simpler workaround offhand, and I think even then you'll need to create a SQL Server Agent Proxy

Found a step by step here: How to schedule SSIS package to run as something other than SQL Agent Service Account

answered on Stack Overflow Jun 6, 2014 by Hart CO • edited May 23, 2017 by Community

User contributions licensed under CC BY-SA 3.0