How to Run SSIS Package through SQL AGENT Job

I am good with SSIS, I created a package which will load the excel files to SQL SERVER  tables. To Implement this I wrote the C# code to extract the first sheet name only, and then
package will load the data present the first sheet only. The package working fine when i run this through BIDS. But the same package throwing error at C# code step when i am running this package through SQL AGENT JOB. When i searched for this, i have seen
many posts saying that, this is happening becoz of using Microsoft.interop.excel references inside the c# code. Please help me with this. Is there any alternate way in c# to extract the first sheet name(not based on ascending order) of an excel file with out
using interop. Or
How to configure SQL AGENT job to run suceessfully when using interop inside the code.
My UAT server is of 64 bit. And i have to run this in the same server.
I tried creating  "Desktop" folder in "C:\Windows\System32\config\systemprofile\"
Error:Description: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.NullReferenceException: Object reference not set to an instance of an object.     at ST_ecfa668f250a45e18c95639c9ffd64d4.csproj.ScriptMain.Main()
    --- End of inner exception stack trace ---     at System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)    
at System.RuntimeMethodHandle.InvokeMethodFast(Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)     at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr,
Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)     at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)     at
System.RuntimeType.InvokeMember(String name, BindingFlags bindingFlags, Binder binder, Object target, Object[] providedArgs, ParameterModifier[] modifiers, CultureInfo culture, String[] namedParams)     at System.Type.InvokeMember(String name, BindingFlags
invokeAttr, Binder binder, Object target, Object[] args, CultureInfo culture)     at Microsoft.SqlServer.Dts.Tasks.ScriptTask.VSTATaskScriptingEngine.ExecuteScript()  End Error  Error: 2015-02-27 11:24:00.23     Code: 0x00000001
    Source: User Mail      Description: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Data.SqlClient.SqlException: A network-related or instance-specific error
occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: Named Pipes Provider, error: 40 - Could
not open a connection to SQL Server)     at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection)     at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj)
    at System.Data.SqlClient.TdsParser.Connect(ServerInfo serverInfo, SqlInternalConnectionTds connHandler, Boolean ignoreSniOpenTimeout, Int64 timerExpire, Boolean encrypt, Boolean trustServerCert, Boolean integratedSecurity, SqlConnection owningObject)
    at System.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo serverInfo, String newPassword, Boolean ignoreSniOpenTimeout, Int64 timerExpire, SqlConnection owningObject)     at System.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(String
host, String newPassword, Boolean redirectedUserInstance, SqlConnection owningObject, SqlConnectionString connectionOptions, Int64 timerStart)     at System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(SqlConnection owningObject, SqlConnectionString
connectionOptions, String newPassword, Boolean redirectedUserInstance)     at System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, Object providerInfo, String newPassword,
SqlConnection owningObject, Boolean redirectedUserInstance)     at System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection)  
  at System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnection owningConnection, DbConnectionPool pool, DbConnectionOptions options)     at System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owning...
 The package execution fa...  The step failed
using System;
using System.Data;
using System.Diagnostics;
using Microsoft.SqlServer.Dts.Runtime;
using System.Windows.Forms;
using System.Data.OleDb;
using Microsoft.Office.Interop;
using System.Runtime.InteropServices;
namespace ST_ecfa668f250a45e18c95639c9ffd64d4.csproj
[System.AddIn.AddIn("ScriptMain", Version = "1.0", Publisher = "", Description = "")]
public partial class ScriptMain : Microsoft.SqlServer.Dts.Tasks.ScriptTask.VSTARTScriptObjectModelBase
#region VSTA generated code
enum ScriptResults
Success = Microsoft.SqlServer.Dts.Runtime.DTSExecResult.Success,
Failure = Microsoft.SqlServer.Dts.Runtime.DTSExecResult.Failure
#endregion
public void Main()
{ /*Passing the file path via User::File_Name Variable*/
string FileName = Dts.Variables["User::File_Name"].Value.ToString();
Microsoft.Office.Interop.Excel.Application xlApp = null;
Microsoft.Office.Interop.Excel.Workbook excelBook = null;
try
xlApp = new Microsoft.Office.Interop.Excel.Application();
excelBook = xlApp.Workbooks.Open(FileName, Type.Missing,
Type.Missing, Type.Missing, Type.Missing,
Type.Missing, Type.Missing, Type.Missing, Type.Missing,
Type.Missing, Type.Missing, Type.Missing, Type.Missing,
Type.Missing, Type.Missing);
string[] excelSheets = new string[excelBook.Worksheets.Count];
int i = 0;
foreach (Microsoft.Office.Interop.Excel.Worksheet wSheet in excelBook.Worksheets)
excelSheets[i] = wSheet.Name;
i++;
Dts.Variables["User::WorkSheetName"].Value = excelSheets[0] + "$";
catch (Exception ex)
excelBook.Close(false, FileName, null);
Marshal.ReleaseComObject(excelBook);
string error = ex.Message;
finally
excelBook.Close(false, FileName, null);
Marshal.ReleaseComObject(excelBook);
Dts.TaskResult = (int)ScriptResults.Success;

I installed office in my machine...but this doesn't solved my problem...
Finally i figured out the solution for this and it is working now, Here is the solution...!
Create the folder with name "Desktop" inside the below mentioned path
C:\Windows\SysWOW64\config\systemprofile\   
But i really don't understand the logic behind this. Can someone explain it pls....

Similar Messages

  • Unable to Run SSIS Package Through SQL Agent Job

    Hi,
    I recently upgraded SQL server 2008 R2 to SQL Server 2012. I also upgraded all the packages on the server. The package runs fine from BIDS. However when I try to run the package through the SQL Agent Job it fails with the error below:
    Executed as user: A. Microsoft (R) SQL Server Execute Package Utility  Version 11.0.2100.60 for 64-bit  Copyright (C) Microsoft Corporation. All rights reserved.    Started:  11:43:04 PM  Could not load package "\FolderA\Package.dtsx"
    because of error 0xC00160AE.  Description: Connecting to the Integration Services service on the computer "S2345WE" failed with the following error: "Access is denied."    By default, only administrators have access to the
    Integration Services service. On Windows Vista and later, the process must be running with administrative privileges in order to connect to the Integration Services service. See the help topic for information on how to configure access to the service.  Source:
      Started:  11:43:04 PM  Finished: 11:43:04 PM  Elapsed:  0.016 seconds.  The package could not be loaded.
    Using Windows Authentication I am able to login to Integration services through SSMS. In the SQL Agent job I am using package store to execute the package. I have admin permission on the server. The integration services currently uses my credentials while
    running.I am not sure why I am getting this error.
    Please advice..
    Thanks,
    EVA05

    Hi ,
    similar thread - http://social.technet.microsoft.com/Forums/en-US/sqlintegrationservices/thread/25e22c7e-bae0-42e4-b86d-2db7a4af519d
    Try this link -
    http://msdn.microsoft.com/en-us/library/dd440760%28v=sql.100%29.aspx
    sathya --------- Please Mark as answered if my post solved your problem and Vote as helpful if my post was useful.

  • Getting error while trying to upload the data in excel from SSIS package through sql agent job

    We are getting below errors.
    Error:
    The Microsoft Jet database engine cannot open the file '\\serversdev\Documents\QC Files\Prod.xls'. It is already opened exclusively by another
    user, or you need permission to view its data.
    Please suggest ASAP
    Regards,
    Ramu
    Ramu Gade

    Hi Dikshan Gade,
    According to your description, you want to upload data from excel to database, when you call ssis package through SQL Server Agent job, you got the error message.
    To troubleshoot the problem, please refer to the following steps:
    Validate that the account has permissions on the file and the folder.
    Verify that the file and the data source name (DSN) are not marked as Exclusive.
    Make sure SQL Server Agent Services service account has the permission to access the database.
    We can check SQL Server Agent’s activity logs, Windows Event logs and SSIS logs to get more clues. Also the tool Process Monitor is helpful to track the cause of registry or file access related issues. For more information about the issue, please refer to
    the following KB article:
    http://support.microsoft.com/kb/306269
    If you have any more questions, please feel free to ask.
    Thanks,
    Wendy Fu
    Wendy Fu
    TechNet Community Support

  • Getting Error while trying to execute SSIS package through sql agent

    Hi,
    I have created a package in SSIS 2008.
    I have created sql Agent job which runs perfectly on my Pc.
    I tried to create anew job on another pc which doesnot have SSIS.
    When i tried to run the Job,
     i am getting folowing error:
    Executed as user: LT-MAGFIH$. tion. End Error DTExec: The package execution returned DTSER_FAILURE (1). Started: 8:51:31 PM Finished: 8:51:35 PM Elapsed: 4.024 seconds. The package execution failed. The step failed.
    Please let me now how can i solve.

    Hi AjayChigurupati,
    I would suggest you check you are install or use the dtexec utility correctly:
    On a 64-bit computer, Integration Services installs a 64-bit version of the
    dtexec utility (dtexec.exe). If you have to run certain packages in 32-bit mode, you will have to install the 32-bit version of the
    dtexec utility. To install the 32-bit version of the
    dtexec utility, you must select either Client Tools or Business Intelligence Development Studio during setup.
    By default, a 64-bit computer that has both the 64-bit and 32-bit versions of an Integration Services command prompt utility installed will run the 32-bit version at the command prompt. The 32-bit version runs because the directory path for the 32-bit
    version appears in the PATH environment variable before the directory path for the 64-bit version. (Typically, the 32-bit directory path is
    <drive>:\Program Files(x86)\Microsoft SQL Server\100\DTS\Binn, while the 64-bit directory path is
    <drive>:\Program Files\Microsoft SQL Server\100\DTS\Binn.)
    For detail information, please see:
    http://technet.microsoft.com/en-us/library/ms162810(v=sql.105).aspx
    To using SQL Server Agent to Run a Package, please refer to the steps in th article below:
    http://technet.microsoft.com/en-us/library/ms138023(v=sql.105).aspx
    If you have any feedback on our support, please click
    here. 
    Elvis Long
    TechNet Community Support

  • Executing SSIS packages through SQL Server Jobs.

    Hi,
    I have an SSIS package which generates xml and text files and ftps it to an ftp site. When i run the package from BIDS it works successfully but when i run it from a job it fails. My SSIS package connects to DB server A and though i'm creating a job on DB
    server A but my folder structure and the package resides in server B from where i'm connecting to DB server A through Management Studio. I'm using File system in SQL server Agent Job to call the package. When i execute the job i get following error:
    Executed as user: I\A. ...er Execute Package Utility  Version 9.00.3042.00 for 64-bit  Copyright (C) Microsoft Corp 1984-2005. All rights reserved.    Started:  5:08:05 PM  Error: 2011-06-21 17:08:05.11         
    Description: Unable to load the package as XML because of package does not have a valid XML format. A specific XML parser error will be posted.  End Error  Error: 2011-06-21 17:08:05.11         Description:
    Failed to open package file "E:\P\H\R\Tools\R\R\R.dtsx" due to error 0x80070003 "The system cannot find the path specified.".  This happens when loading a package and the file cannot be opened or loaded correctly into the XML document. This can be the
    result of either providing an incorrect file name was specified when calling LoadPackage or the XML file was specified and has .  The step failed.
    Could you please tell me where am i going wrong?
    Thanks,
    Deepti
    Deepti

    Hi Christa Kurschat,
    I'm running the job under proxy account. And that account has sysadmin permissions.
    I used following script to create proxy account and run my package under that account:
    I. Create job executor account
    Highlight Security->New Login, say to make login as devlogin, type your password, default database can be your target database.
    Server roles: check �sysadmin�
    User mapping: your target database
    Msdb database: you make sure to include
    SQLAgentUserRole, SQLAgentReaderRole,  SQLAgentOperatorRole
    Then click OK
    II. Create SQL proxy account and associate proxy account with job executor account
    Here is the code and run it the query window.
    Use master
    CREATE CREDENTIAL [MyCredential] WITH IDENTITY = 'yourdomain\myWindowAccount', secret = 'WindowLoginPassword'
    Use msdb
    Sp_add_proxy @proxy_name='MyProxy', @credential_name='MyCredential'
    Sp_grant_login_to_proxy @login_name=' devlogin', @proxy_name='MyProxy'
    Sp_grant_proxy_to_subsystem @proxy_name='MyProxy', @subsystem_name='SSIS'
    III. Create SSIS package
    In MS SQL Server Business Intelligence Development Studio, you use job executor account devlogin to create the SSIS package (DTS) and make sure you can execute this package
    in SQL Server Business Intelligence Development Studio. Compile/build this package.
    IV. Create the job, schedule the job and run the job
    In SQL Server Management Studio, highlight SQL Server Agent -> Start. Highlight Job ->New Job�, name it , myJob.
    Under Steps, New Step, name it, Step1,
    Type: SQL Server Integration Service Package
    Run as: myProxy
    Package source: File System
    Browse to select your package file xxx.dtsx
    Click Ok
    Schedule your job and enable it
    I followed these steps.
    Thanks,
    Deepti
    Deepti

  • Error: Failed to acquire connection while exporting a file using SSIS package through SQl Server Agent job.

    Hi Team,
    I am running a sql server job which is loading data to a sharepoint document library.File is an excel format and is getting loaded
    when executed through SSDT solution .But when i am using an SQL Agent job to pick up the file it doesnt get the path and agent job fails with the error "Failed to acquire connection".I have deployed the SSIS Package through SQL Server 2012 deployment
    methodologies.
    I am not able to trace the error of loading data from a sharepoint library.library. Sql agent jobs works fine when i give local path.The
    account which is running the sql agent job is the same who has access to document library.I also tried to run the job through proxy account. I am using a xml configuraion to store my credentials.I am able to palce the same file to a network drive in the same
    server through sql server agent job. The only problem is when I am trying to load the file to a sharepoint folder.
    Thanks,
    Arsa..

    Is that the WebDAV method that you are suggesting here to map the n/w drive?
    Its kind of webdav but you will be using windows nw drive to store data
    yes, I am able to create the file to D: , but didn't check with the C:.
    Try with c:, as c: require special permisssions
    If this helped you resolve your issue, please mark it Answered

  • SSIS ETL does not pick the file from Share point when it execute through SQL Agent job

    I have created one SSIS packages, which pick the file from the Share point document library. its work successfully, once it execute through the VS project application. 
    But when i create a job in SQL Server Agent for this package then it does not pick the file and job getting fail. 
    Just for more update, SQL Server has been install in Cluster mode and using BIDS 2012 with SQl Server 2012.

    Hi PriyankGupta,
    SQL Server Integration Services is not cluster awareness, and does not support failover from one cluster node to another. So, in your clustered environment, make sure SSIS is installed on each node in the cluster. In other word, SSIS must be installed on
    the server where the SQL Server Agent job is created. 
    If you use any third party task/component or drivers, make sure they are installed on the SQL Server Agent job server. Besides, also pay attention to the protection level of the package as well as 32-bit or 64-bit runtime mode of the package. For more information,
    please see:
    http://social.technet.microsoft.com/Forums/systemcenter/en-US/e13c137c-1535-4475-8c2f-c7e6e7d125fc/how-do-i-troubleshoot-ssis-packages-failed-execution-in-a-sql-agent-job 
    If the issue persists, please post the error message in the job history for further analysis.
    Regards,
    Mike Yin
    TechNet Community Support

  • How to Execute SSIS package through MySQL Procedure

    Hi Everyone,
    How to Execute SSIS package from MySQL Stored Procedure.
    Please share your suggestions on this.
    Regards,
    Vaishu

    I am not sure whether you have SSIS license version installed in the system where MYSQL is there. In order to run SSIS package we need to have DTEXEC executable file and it comes with SSIS license version.
    An SSIS package can be executed from command prompt as,
    C:\>dtexec /f E:\package.dtsx
    I am not expert in MYSQL however in TSQL we can run dos command or scripting language such as vbscript.
    Similarly you need to check in MYSQL. This is MSSQL Server forum.
    Refer
    http://www.ehow.com/how_8789576_call-ssis-package-vbscript.html
    http://www.mssqltips.com/sqlservertip/1775/different-ways-to-execute-a-sql-server-ssis-package/
    Regards, RSingh

  • SSIS package and sql agent issue

    Hi guys, I don't know if is the perfect place but I've got a question about running SSIS package from the Job Agent. The problem that I am having this issue: Access Denied.
    What I do is to put the package in a folder in my network where everyone is able to read and write. Of course if I double click the package it's works, bear in mind that the package write in the Database FORUM and I am the only one that has access to the
    database. So if one of my colleague try it doesn't work. But, two questions:
    1) SQL agent need to be configured as a normal user or automatically if you put a package in SQL Agent it can write everywhere?
    2)Most important, in network terms should I ask to the administrator to set up NAMENETWORK\NAMESERVER$ in order to read/write from the table where the package is?

    Sorry...resolved. I set up a proxy with my credentials and now it's running good.

  • Management Studio Crashing When Adding SSIS Step to SQL Agent Job

    Hi
    I am running Windows Server 2012, SQL Server 2012 SP2 CU2, SQL Server Management Studio 2012 and Visual Studio 2012.
    I have existing SQL Agent Jobs that run SSIS packages and they all currently work. However, if I try to edit them or add a new job that uses a SSIS package Management Studio will crash.  I was having this problem a couple weeks ago when I was still
    on SQL Server 2012 SP1 CU9, so I updated to SQL Server 2012 SP2 CU2 and the problem went away for a couple weeks and I was able to add new SQL Agent jobs that run SSIS packages.  But now it issue is back and there are no new updates to try and fix it.
    Has anyone seen this before and found a reliable fix to it?
    Steps to cause crash:
    1) Open new SQL Agent Job
    2) Select Steps and add a New Step
    4) Change the job type to SQL Server Integration Services Package.
    5) SSMS Crashes
    Error Message Below:
    ===================================
    The type initializer for '<Module>' threw an exception. (SqlManagerUI)
    Program Location:
       at Microsoft.SqlServer.Management.SqlManagerUI.DTSJobSubSystemDefinition.Microsoft.SqlServer.Management.SqlManagerUI.IJobStepPropertiesControl.Load(JobStepData data)
       at Microsoft.SqlServer.Management.SqlManagerUI.JobStepProperties.UpdateJobStep()
       at Microsoft.SqlServer.Management.SqlManagerUI.JobStepProperties.typeList_SelectedIndexChanged(Object sender, EventArgs e)
       at System.Windows.Forms.ComboBox.OnSelectedIndexChanged(EventArgs e)
       at System.Windows.Forms.ComboBox.WmReflectCommand(Message& m)
       at System.Windows.Forms.ComboBox.WndProc(Message& m)
       at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
       at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
       at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
       at System.Windows.Forms.UnsafeNativeMethods.SendMessage(HandleRef hWnd, Int32 msg, IntPtr wParam, IntPtr lParam)
       at System.Windows.Forms.Control.SendMessage(Int32 msg, IntPtr wparam, IntPtr lparam)
       at System.Windows.Forms.Control.ReflectMessageInternal(IntPtr hWnd, Message& m)
       at System.Windows.Forms.Control.WmCommand(Message& m)
       at System.Windows.Forms.Control.WndProc(Message& m)
       at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
       at System.Windows.Forms.ContainerControl.WndProc(Message& m)
       at System.Windows.Forms.UserControl.WndProc(Message& m)
       at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
       at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
       at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
       at System.Windows.Forms.UnsafeNativeMethods.CallWindowProc(IntPtr wndProc, IntPtr hWnd, Int32 msg, IntPtr wParam, IntPtr lParam)
       at System.Windows.Forms.NativeWindow.DefWndProc(Message& m)
       at System.Windows.Forms.Control.DefWndProc(Message& m)
       at System.Windows.Forms.Control.WmCommand(Message& m)
       at System.Windows.Forms.Control.WndProc(Message& m)
       at System.Windows.Forms.ComboBox.WndProc(Message& m)
       at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
       at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
       at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
       at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
       at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
       at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
       at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
       at System.Windows.Forms.Application.RunDialog(Form form)
       at System.Windows.Forms.Form.ShowDialog(IWin32Window owner)
       at System.Windows.Forms.Form.ShowDialog()
       at Microsoft.SqlServer.Management.SqlManagerUI.JobSteps.newJobStep_Click(Object sender, EventArgs e)
       at System.Windows.Forms.Control.OnClick(EventArgs e)
       at System.Windows.Forms.Button.OnClick(EventArgs e)
       at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
       at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
       at System.Windows.Forms.Control.WndProc(Message& m)
       at System.Windows.Forms.ButtonBase.WndProc(Message& m)
       at System.Windows.Forms.Button.WndProc(Message& m)
       at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
       at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
       at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
       at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
       at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
       at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
       at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
       at System.Windows.Forms.Application.RunDialog(Form form)
       at System.Windows.Forms.Form.ShowDialog(IWin32Window owner)
       at System.Windows.Forms.Form.ShowDialog()
       at Microsoft.SqlServer.Management.SqlMgmt.RunningFormsTable.RunningFormsTableImpl.ThreadStarter.StartThread()
    ===================================
    The C++ module failed to load.
     (DTEParseMgd)
    Program Location:
       at <CrtImplementationDetails>.LanguageSupport.Initialize(LanguageSupport* )
       at .cctor()
    ===================================
    Index was outside the bounds of the array. (DTEParseMgd)
    Program Location:
       at _getFiberPtrId()
       at <CrtImplementationDetails>.LanguageSupport._Initialize(LanguageSupport* )
       at <CrtImplementationDetails>.LanguageSupport.Initialize(LanguageSupport* )
    Thanks,
    Anthony

    I ended up being able to work around this without having to recreate everything on a Windows Server 2008 R2. I did this by setting up an azure point to site VPN from
    my computer to the Windows Server 2012 hosted on azure.  I was then able to connect SSMS from my computer to the Azure VM allowing me to create and edit new SQL Agent jobs that run SSIS packages. Here are the steps to do this
    1) Connect to the VPN from another machine besides the server.
    2) Open SSMS using the runas.exe command with the Domain\User Name of a Windows account on the server.
    - Ex. Runas.exe /netonly /user:DOMAIN\USER "C:\Program Files (x86)\Microsoft SQL Server\110\Tools\Binn\ManagementStudio\Ssms.exe"
    2) Connect to the VM's Database Engine using its internal IP address and the port that SQL Server is listening on (default is 1433) and a SQL Login
    setup on the server.
    -Ex IP, 10.0.0.1,1433
    3) Create a new job with the type SQL Server Integration
    Services Package. Select the package source (SSIS Catalog). I could not get the server to be automatically discovered here so enter the server’s internal IP address and select the package you want to run.
    4) Right click the new SQL Agent Job and choose Script Job As, CREATE To, New Query Window. This is the script to create the
    SQL Agent Job and it needs to be edited to contain the Name of the server on the internal IP address that was used earlier.
    5) Edit the @command= line of the script to use the server name. Change the highlighted part below to the server name.
    - Ex . @command=N'/ISSERVER "\"\SSISDB\PACKAGELOCATION\"" /SERVER
    "\"10.0.0.1\"" /Par "\"$ServerOption::LOGGING_LEVEL(Int16)\"";1 /Par "\"$ServerOption::SYNCHRONIZED(Boolean)\"";True /CALLERINFO SQLAGENT /REPORTING E',
                - Change to this
                            - @command=N'/ISSERVER "\"\SSISDB\PACKAGELOCATION\""
    /SERVER SERVERNAME /Par "\"$ServerOption::LOGGING_LEVEL(Int16)\"";1 /Par "\"$ServerOption::SYNCHRONIZED(Boolean)\"";True /CALLERINFO SQLAGENT /REPORTING E',
    6) Now change the name of the package in the script and run it. Now the new package can be edited in the GUI to change things like the schedule and alerts. Also you
    can edit any existing packages.

  • Suggestions for how to execute file maintenance in SQL Agent Job

    I need to create a SQL Agent Job (it has to be a SQL agent job) to zip all files in a directory, delete all files in the directory but the zip file and then copy the zip file to another location across a UNC path. What are some suggestions for getting
    this done? 
    Thanks.

    This is about a previous topic ...
    "1. Please close your preview thread by marking the answers that you got and not your own summary. Actualy you can mark your summary as well if you feel that this close the thread but yet, this is a summary of the answers that you got! People
    that help you Invested time to help you. Feel free to
    not be lazy and start you can start voting helpful responses as well :-)"
    How do you mark useful answers? I have not seen how to do that.
    On the left of each response you have an icon (small image).
    I have asked lots of questions on the TechNet and other forums. (One day I hope to even answer some.) That was the first time I had ever marked my own as the answer. Honestly, I did not use any of those well meaning replies and did not feel that any of them
    answered my question. When researching a topic I, like most people, I look at the marked answer first and assume it is the answer. Did not feel that  any of them were the answer. There is a great push on this forum to mark the answer and there are droves
    of people clamoring for points (BTW - you are not one of them). I review each of my questions, always follow up on any  replies, post my solution if appropriate, and always try to close the topic. But this one was not answered.
    OK, that is logic, If you dont think that you use other response as part of the answer. In my opinion (and you dont have to get it) if an answer is build from 3 responses together then we need to mark all the three (and mentioned in the summery what we have
    done). If you find that those response cant be called "answer" since they do not cover enough then maybe your call was correct.
    Please close the thread in the way that you feel is OK :-)
    (you dont have to accept my opinion since you have your explanation, but i do think that some of the responses there are answers).
    [Personal Site] [Blog] [Facebook]

  • Error trying to run SSIS Package via SQL Server Agent: DTExec: Could not set \Package.Variables[User::VarObjectDataSet].Properties[Value] value to System.Object

    Situation:
    SSIS Package designed in SQL Server 2012 - SQL Server Data Tools
    Windows 7 - 64 bit.
    The package (32 bit) extracts data from a SQL Server db to an Excel Output file, via an OLE DB connection.
    It uses 3 package variables:
    *) SQLCommand (String) to specify the SQL Statement to be executed by the package
    Property path: \Package.Variables[User::ExcelOutputFile].Properties[Value]
    Value: f:\Output Data.xls
    *) EXCELOutputFIle (String) to specify path and filename of the Excel output file
    Property path: \Package.Variables[User::SQLCommand].Properties[Value]
    Value: select * from CartOrder
    *) VarObjectDataSet (Object) to hold the data returned by SQL Server)
    Property path: \Package.Variables[User::VarObjectDataSet].Properties[Value]
    Value: System.Object
    It consists out of 2 components:
    *) Execute SQL Task: executes the SQL Statement passed on via a package variable. The resultng rows are stored in the package variable VarObjectDataSet
    *) Script Task: creates the physical output file and iterates VarObjectDataSet to populate the Excel file.
    Outcome and issue:The package runs perfectly fine both in SQL Server Data Tools itself and in DTEXECUI.
    However, whenever I run it via SQL Server Agent (with 32 bit runtime option set), it returns the errror message below.
    This package contains 3 package variables but the error stating that a package variable can not be set, pops up for the VarObjectDataSet only.  This makes me wonder if it is uberhaupt possible to set the value of a package variable
    of type Object.
    Can anybody help me on this please ?
    Message
    Executed as user: NT Service\SQLSERVERAGENT. Microsoft (R) SQL Server Execute Package Utility  Version 11.0.2100.60 for 32-bit  Copyright (C) Microsoft Corporation. All rights reserved.    Started:  6:40:20 PM  DTExec: Could
    not set \Package.Variables[User::VarObjectDataSet].Properties[Value] value to System.Object.  Started:  6:40:20 PM  Finished: 6:40:21 PM  Elapsed:  0.281 seconds.  The package execution failed.  The step failed.
    Thank you very much in advance
    Jurgen

    Hi Visakh,
    thank you for your reply.
    So, judging by your reply, not all package variables used inside a package need to be set a value for when run in DTEXEC ?
    I already tried that but my package ended up in error (something to do with "... invocation ...." and that error is anything but clearly documented. Judging by the error message itself, it looks like it could be just about anything. that is why I asked my
    first question about the object type package variable.
    Now, I will remove it from the 'set values' list and try another go cracking the unclear error-message " ... invocation ...". Does an error message about " ... invocation ..." ring any bells, now that we are talking about it here ?
    Thx in advance
    Jurgen
    Yes exactly
    You need to set values only forthem which needs to be controlled from outside the package
    Any variable which gets its value through expression set inside package or through a query inside execute sql task/script task can be ignored from DTExec
    Ok I've seen the invocation error mostly inside script task. This may be because some error inside script written in script task. If it appeared after you removed the variable then it may because some reference of variable existing within script task.
    Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs

  • Scheduling SSIS packages through SQL Server Agent

    Hello All!  I have an SSIS question for BPC 7.5 installations across multiple servers.  I have been rebuilding all my DTS packages over to SSIS and trying to learn this more dynamic environment.  Currently I have saved a copy of all my rebuilt packages from BIDS (on web server)  to the MSDB located on the SQL server.  I can manually run packages from Integration Services and load data successfully.  When I try to schedule packages based on the packages stored in MSDB, I get failures.  The errors initially suggested I was passing over a NULL password, so I adjusted the protection level of the package to ServerStorage, as opposed to the default setting.
    Now I have the following error when I schedule and run it:
    Message
    Executed as user: AMERICREDIT\svcbpc_ssis_dev. Microsoft (R) SQL Server Execute Package Utility  Version 10.0.2531.0 for 64-bit  Copyright (C) Microsoft Corp 1984-2005. All rights reserved.    Started:  11:48:00 AM  Error: 2011-02-28 11:48:02.05     Code: 0xC0010018     Source: Convert Task 2008      Description: Failed to load task "Convert Task 2008", type "OSoft.Services.Application.DataMgr.Task.SSISConvert, OSoftTaskConvert2008, Version=7.0.112.0, Culture=neutral, PublicKeyToken=bf6c37fa78f5a648". The contact information for this task is "".  End Error  Error: 2011-02-28 11:48:02.06     Code: 0xC0010018     Source: DumpLoad Task 2008      Description: Failed to load task "DumpLoad Task 2008", type "OSoft.Services.Application.DataMgr.Task.SSISTaskDumpLoad, OSoftTaskDumpLoad2008, Version=7.0.112.0, Culture=neutral, PublicKeyToken=bf6c37fa78f5a648". The contact information for this task is "".  End Error  Error: 2011-02-28 11:48:02.13     Code: 0xC0010026     Source: Convert Task 2008      Description: The task has failed to load. The contact information for this task is "".  End Error  Error: 2011-02-28 11:48:02.13     Code: 0xC0024107     Source: Convert Task 2008      Description: There were errors during task validation.  End Error  Error: 2011-02-28 11:48:02.13     Code: 0xC0010025     Source: Z6_VW_STAT_APLN_CURR      Description: The package cannot execute because it contains tasks that failed to load.  End Error  DTExec: The package execution returned DTSER_FAILURE (1).  Started:  11:48:00 AM  Finished: 11:48:02 AM  Elapsed:  1.406 seconds.  The package execution failed.  The step failed.
    It appears I cannot execute any of the BPC custom tasks in the SSIS packages.  Any recommendations?

    Thanks, James, your point is well taken.  Originally we were importing packages into the file system, but had the same results when scheduling.
    Below is the message received when I schedule a package located in the stored package file system from my web server:
    Executed as user: AMERICREDIT\svcbpc_ssis_dev. Microsoft (R) SQL Server Execute Package Utility  Version 10.0.2531.0 for 64-bit  Copyright (C) Microsoft Corp 1984-2005. All rights reserved.    Started:  10:36:00 AM  Error: 2011-03-01 10:36:02.56     Code: 0xC0010018     Source: Convert Task 2008      Description: Failed to load task "Convert Task 2008", type "OSoft.Services.Application.DataMgr.Task.SSISConvert, OSoftTaskConvert2008, Version=7.0.112.0, Culture=neutral, PublicKeyToken=bf6c37fa78f5a648". The contact information for this task is "".  End Error  Error: 2011-03-01 10:36:02.58     Code: 0xC0010018     Source: DumpLoad Task 2008      Description: Failed to load task "DumpLoad Task 2008", type "OSoft.Services.Application.DataMgr.Task.SSISTaskDumpLoad, OSoftTaskDumpLoad2008, Version=7.0.112.0, Culture=neutral, PublicKeyToken=bf6c37fa78f5a648". The contact information for this task is "".  End Error  Error: 2011-03-01 10:36:02.62     Code: 0xC0010026     Source: Convert Task 2008      Description: The task has failed to load. The contact information for this task is "".  End Error  Error: 2011-03-01 10:36:02.62     Code: 0xC0024107     Source: Convert Task 2008      Description: There were errors during task validation.  End Error  Error: 2011-03-01 10:36:02.62     Code: 0xC0010025     Source: Z6_VW_STAT_APLN_CURR      Description: The package cannot execute because it contains tasks that failed to load.  End Error  DTExec: The package execution returned DTSER_FAILURE (1).  Started:  10:36:00 AM  Finished: 10:36:02 AM  Elapsed:  1.954 seconds.  The package execution failed.  The step failed.
    Could this be a security thing?  If so, what would my security need to be set up from the package level?

  • How to run Exe file through Sql server agent job

    Hello All
    i have 2 servers 
    1.Application Server
    2.Database server
    Application server has a .exe file so i wanted to run this exe file through SQL server agent job from database server.
    What is the process for run this Exe file 
    Can you plz suggest me step by step process
    Kamal

    While i'm trying to implement this below method
    Step1 : Right Click SQL Server Agent. Select New -> Job. This will open a wizard to schedule a new
    job.
    Step2 : Select Steps from options given on the left side of wizard. This is the main place to set your
    exe\program as a running step. Give some name to this step, Select Operating System (cmdexec) for the Type and give the full path of exe in Text box for Command.
    ex:\\10.11.00.98(your application serverIP)\ch.exe
    Thanks vanchan-Please
    mark this reply as the answer or vote as helpful, as appropriate, to make it useful for other readers
    I got this below error
    Message
    Executed as user:NJROSJ345\SYSTEM. The process could not be created for step1 of job
    (Reason:Access is Denied)The step failed.
    But i have sys admin rights on the both the servers 
    Kamal

  • Running SSIS 2005 in SQL Server Job Agent 2012

    Hi Guys,
    I'm trying to create a job in SQL 2012 that calls an SSIS 2005 package, however i'm getting some issue.  I researched the issue a bit and got this link . The given link suggested to use dtexec as SQL 2012 try to convert it in the memory.
    I used the dtexec  but I'm still getting an issue.
    "Executed as user: NT Service\SQLSERVERAGENT. Microsoft (R) SQL Server Execute Package Utility  Version 9.00.1399.06 for 32-bit  Copyright (C) Microsoft Corp 1984-2005. All rights reserved.    Started:  4:11:19 PM  Error:
    2015-04-13 16:11:26.24     Code: 0xC0012024     Source: OTH Market Exist?      Description: The task "OTH Market Exist?" cannot run on this edition of Integration Services. It requires a higher level edition.  End
    Error  Error: 2015-04-13 16:11:26.24     Code: 0xC0012024     Source: Arcticle CSV Exist?      Description: The task "Arcticle CSV Exist?"
    cannot run on this edition of Integration Services. It requires a higher level edition.  End Error  Error: 2015-04-13 16:11:26.24     Code: 0xC0012024     Source: BV Market Exist?      Description:
    The task "BV Market Exist?" cannot run on this edition of Integration Services. It requires a higher level edition.  End Error  Error: 2015-04-13 16:11:26.51     Code: 0xC002F210     Source: No Input
    Files Email Execute SQL Task     Description: Executing the query "DECLARE @result int;  EXEC @result = security.dbo.spSendEmail  
    @Subject='[GFK Import & Export] - All Input Files Are Missing',  
    @Message ='Processing has been stopped due to missing input files',  
    @ToID =25,   @ccID =0,  
    @Attachment =''" failed with the following error: "Database 'security' does not exist. Make sure that the name is entered correctly.". Possible failure reasons: Problems with the query, "ResultSet" property not set correctly,
    It seems that I do need to upgrade my packages to run in SQL 2012 unless if there's another way without upgrading it that would be great.
    I just want to get the confirmation if possible or not
    Many thanks guys.

    Hi Vaibhav,
    I created 2 jobs. the first job calls a simple package that execute a single SQL. It ran
    successfully when I execute the said job using this command 
    DTEXEC /FILE "\"C:\TFS\WDSHE SSIS Packages from DTS\GFK_Test_package.dtsx\"" /DECRYPT stud10 /CHECKPOINTING OFF /REPORTING E
    2nd Job, calls a complex package which contains several execute process tasks. this job fails with the error mentioned at the top.
    Now, I modified the simple package in the first job and add an Execute Process Task.
    I'm started to get an issue
    Message
    Executed as user: NT Service\SQLSERVERAGENT. Microsoft (R) SQL Server Execute Package Utility  Version 9.00.1399.06 for 32-bit  Copyright (C) Microsoft Corp 1984-2005. All rights reserved.    Started:  4:51:57 PM  Error: 2015-04-13
    16:52:01.32     Code: 0xC0012024     Source: Unzip BV ZIP      Description: The task "Unzip BV ZIP" cannot run on this edition of Integration Services. It requires a higher level edition.  End Error  DTExec:
    The package execution returned DTSER_FAILURE (1).  Started:  4:51:57 PM  Finished: 4:52:01 PM  Elapsed:  4.212 seconds.  Process Exit Code 1.  The step failed.
    Have you had a similar issues before?
    I will try to install the SSIS service and see how I go. thanks for the link

Maybe you are looking for