Will dynamic Excel commands in a C# Edit Script run ok as a SSISDB Package and a SQL Server Agent Job?

I've seen some conflicting things in terms of dynamic Excel commands running in a SSISDB Package and a scheduled SQL Server Agent Job...things like that it's not supported...that it won't work...etc...
It's a pretty simple script...to open up a .xlsx file and save it as a .xls file. I am trying to be proactive here and the reason I did it this way is because I could not source the .xlsx file and then I couldn't use OLE DB sourcing because I think the .xlsx
file wants you to use Microsoft.ACE.OLEDB.12.0 and that entails installing the 64-bit Microsoft Access Database Engine and I cannot do that because our network version of Microsoft Office 2010 is 32-bit and in order to install the 64-bit Microsoft Access Database
Engine 2010 it's prompting me to uninstall Microsoft Office 2010 and that is not possible.
Ugh!
So I'm hoping that I can promote and deploy this current SSIS Package to Production and create a SQL Server Agent Job that will successfully run this and its dynamic Excel commands.
Do you know of any hurdles with this? Any anomalies...struggles...
Thanks for your review and am hopeful for a reply.
Here's the C# Script...which works perfectly client side...
string StrFileName = (Dts.Variables["User::FileName"].Value.ToString());
StrFileName = Path.GetFileNameWithoutExtension(StrFileName);
string StringSourceFile = (Dts.Variables["User::FilePath"].Value.ToString()) + StrFileName + ".xlsx";
string StringDestinationFile = (Dts.Variables["User::FilePath"].Value.ToString()) + StrFileName + ".xls";
// This initiates the Excel Application
Microsoft.Office.Interop.Excel.Application excelApplication = new Microsoft.Office.Interop.Excel.Application();
// This Opens the Source .xlsx File from Emdeon ePaySmart
Workbook workbook = excelApplication.Workbooks.Open(StringSourceFile, XlUpdateLinks.xlUpdateLinksNever, true, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing);
// This will Save the Source .xlsx Emdeon ePaySmart File as a .xls File...note xlFileFormat.xlExcel5
workbook.SaveAs(StringDestinationFile, XlFileFormat.xlExcel8, Type.Missing, Type.Missing, Type.Missing, Type.Missing, XlSaveAsAccessMode.xlExclusive, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing);
// This will Close the Source
workbook.Close(false, Type.Missing, Type.Missing);
// This shuts down the Excel Application
excelApplication.Quit();

This should work if you use a proxy to run this package in the Agent; see:
http://www.mssqltips.com/sqlservertip/2163/running-a-ssis-package-from-sql-server-agent-using-a-proxy-account/
Arthur
MyBlog
Twitter

Similar Messages

  • What is the best way to read, process, and write an Excel File Server side...SQL Server Agent Job

    So I was using dynamic Excel commands to open and save as using...
    Microsoft.Office.Interop.Excel.Application
    and
     workbook.SaveAs(StringDestinationFile, XlFileFormat.xlExcel8, Type.Missing, Type.Missing, Type.Missing, Type.Missing, XlSaveAsAccessMode.xlExclusive, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing);
    which worked all fine and dandy client side. Then when I attempted to create a SQL Server Agent Job, this failed as a result of SQL Server side not being able to execute dynamic Excel commands.
    So do I need to therefore try and do this function via Microsoft.ACE.OLEDB.12.0 commands? And where can I find the commands and syntax to open and save as? I have to Open a .xlsx file, save it as a .xls file, and then open this newly created .xls file and
    then save it as a .csv file.
    Thanks for your review and am hopeful for a reply.
    ITBobbyP85

    I think you might be over complicating things.
    You can use SSIS with Excel Source/Destination connections to read in, or output to an excel sheet/file.

  • VBScript Runs Correctly From Command Prompt, But Not From SQL Server Agent Job

    I'm trying to run this script on my local machine to do some post-batch cleanup and it doesn't run correctly from the scheduled job (or when I invoke the job).
    Here's the script in question:
    Option Explicit
    Const filePath = "C:\Documents and Settings\jmunn\My Documents\Visual Studio 2008\Logs\"
    Const holdDays = 6
    main
    Sub Main()
    ClearArchive
    End Sub
    Sub ClearArchive()
    Dim fso 'As Scripting.FileSystemObject
    Dim fld 'As Scripting.Folder
    Dim f 'As Scripting.File
    Dim delLogName, delLogOut, delCtr
    Set fso = CreateObject("Scripting.FileSystemObject")
    Set fld = fso.GetFolder(filePath)
    delLogName = filePath & "Nightly Backup - Backup Logs Deleted" & ".txt"
    Set delLogOut = fso.CreateTextFile(delLogName, True)
    delLogOut.WriteLine(delLogName)
    delLogOut.WriteLine("")
    delLogOut.WriteLine("-- The following log files were deleted on " & DateValue(Now()) & " at " & TimeValue(Now()))
    delLogOut.WriteLine("")
    delCtr = 0
    For Each f In fld.Files
    If Left(f.Name, 48) = "Nightly Backup - SQL Server Databases_Subplan_1_" And Right(LCase(f.Name), 4) = ".txt" Then
    If DateDiff("d", f.DateCreated, Date()) > holdDays Then
    delLogOut.WriteLine(f.Name)
    fso.DeleteFile f, True
    delCtr = delCtr + 1
    End If
    End If
    Next
    If delCtr = 0 Then
    delLogOut.WriteLine("No log files were deleted this run...")
    End If
    Set fld = Nothing
    Set fso = Nothing
    delLogOut.Close
    End Sub
    If I put the script in its own file and run it from the command prompt, it runs just fine. If the script runs from the SQL Server Agent job, the for-loop will delete the files correctly, but the filenames
    do not get written to the deletion log file and the counter does not get incremented, so according to the job log, nothing was deleted. Why does the script run differently from each invocation? It can't be a permission thing, the service that logs in has full
    access to the directory and the files do get deleted. Any ideas out there?
    Between this and other outstanding issues, I'm quickly losing faith in SQL Server.  >=o(
    Thanks in advance for your thoughts!
    John
    Version Info:
    Microsoft SQL Server Management Studio      10.0.2531.0
    Microsoft Analysis Services Client Tools      10.0.1600.22
    Microsoft Data Access Components (MDAC)      3.85.1132
    Microsoft MSXML      2.6 3.0 4.0 5.0 6.0
    Microsoft Internet Explorer      8.0.6001.18702
    Microsoft .NET Framework      2.0.50727.3603
    Operating System      5.1.2600
    "A bus station is where a bus stops. A train station is where a train stops. On my desk I have a workstation..."

    Hi
    jrmunn
    i am trying to execute VB script to refresh my excel files.. using Vbscript file through SQL Agent job step.
    i have copied VBscript in a file with the extension RefreshExcel.vbs kept in C:\RefreshExcel.vbs
    Below is the script used inside the file (RefreshExcel.vbs)
    //---Script code-----------------------------------------------------------------
    Dim objXL, objWB
    Dim FileLocation, FileName
    On Error Resume Next
    'lgnConn = 1
    FileLocation = "F:\Reports\Reports"
    Set objXL = CreateObject("Excel.Application")
    objXL.DisplayAlerts = False
    FileName = "ReportFile1.xlsx"
    'MsgBox (FileLocation & "/" & FileName)
    Set objWB = objXL.Workbooks.Open(FileLocation & "/" & FileName)
    objWB.EnableConnections
    objXL.CalculateUntilAsyncQueriesDone
    objWB.RefreshAll
    objXL.CalculateUntilAsyncQueriesDone
    objWB.RefreshAll
    objXL.CalculateUntilAsyncQueriesDone
    objWB.Save
    objWB.Close
    Set objWS = Nothing
    Set objWB = Nothing
    objXL.Quit
    Set objXL = Nothing
    'MsgBox ("Refresh Completed")
    ---------------------------------------------------------------------------------------------------//Script complete
    Now when i am trying to call this script file in SQL agent job step (as you mentioned )
    as Type -cmdExec(OperatingSystem)
    cscript "C:\RefreshExcel.vbs"
    Issue: job step executed succesfully ,,but without performing any refresh on the excel. So i am not understandig what is going wrong. the same script file work when i am calling it through a batch file (window scheuler task). But it doesnt support
    to run the file "when user is not logged in"
    that is why  i want to refresh my excel file through sql agent ,which can be scheduled to any time and cab be run as SQL agent credentials.
    Can you please help me on this ...i have tried all the option but nothing working .. found hope by seeing your solution.
    Thanks in advance.
    Please help me. :-(

  • Excel Import Fails in SQL Server Agent Job but not when executed in BIDS

    We have a SQL Server agent job that has ran successfully for the past 6 months.  It started failing about a week ago.  I don't believe anyone installed anything on the server.  The proxy account used to run the job is an admin on the server.   
    I've tried everything I can think of or that I found on searches.  I even changed the connection manager from an Excel source to using an Microsoft office 12.0 Access Database Engine OLEDB connection and it still runs in BIDs and not as an agent job. 
    I also setup my LANID as a proxy account to see if the job would run (checking security) -- and it fails with the same error.   I also made sure the path is
    \\server\share rather than a drive letter.   Any ideas?
    The package is executed in 32 bit mode.  The package still runs fine in BIDS (where BIDs is opened on the server) but fails in the SQL Agent job with:
    Executed as user: xxxxxx\xxxxxx. Microsoft (R) SQL Server Execute Package Utility  Version 11.0.2100.60 for 32-bit  Copyright (C) Microsoft Corporation. All rights reserved.    Started:  9:00:00 AM  Error: 2014-12-01 09:00:02.46    
    Code: 0xC0202009     Source: xxxxxx Connection manager "Excel Connection Manager"     Description: SSIS Error Code DTS_E_OLEDBERROR.  An OLE DB error has occurred. Error code: 0x80004005.  An OLE
    DB record is available.  Source: "Microsoft Access Database Engine"  Hresult: 0x80004005  Description: "External table is not in the expected format.".  End Error  Error: 2014-12-01 09:00:02.65    
    Code: 0xC020801C     Source: Load File to Staging Excel Source [43]     Description: SSIS Error Code DTS_E_CANNOTACQUIRECONNECTIONFROMCONNECTIONMANAGER.  The AcquireConnection method call to the connection manager
    "Excel Connection Manager" failed with error code 0xC0202009.  There may be error messages posted before this with more information on why the AcquireConnection method call failed.  End Error  Error: 2014-12-01 09:00:02.77    
    Code: 0xC0047017     Source: Load File to Staging SSIS.Pipeline     Description: Excel Source failed validation and returned error code 0xC020801C.  End Error  Error: 2014-12-01 09:00:02.90    
    Code: 0xC004700C     Source: Load File to Staging SSIS.Pipeline     Description: One or more component failed validation.  End Error  Error: 2014-12-01 09:00:03.02     Code: 0xC0024107    
    Source: Load File to Staging      Description: There were errors during task validation.  End Error  DTExec: The package execution returned DTSER_FAILURE (1).  Started:  9:00:00 AM  Finished: 9:00:03 AM 
    Elapsed:  2.761 seconds.  The package execution failed.  The step failed.

    I logged on to the server with the account that the SQL Agent runs under and ran the following from a command
    line to execute the package:
    "D:\Program Files (x86)\Microsoft SQL Server\110\DTS\Binn\DTEXEC.exe" /FILE
    "\"K:\SSIS\xxxxxx\xxxxx.dtsx\"" /CHECKPOINTING OFF 
    /REPORTING EWCDI  /X86
    I wanted to see if it was a security issue with the agent account account - but
    this ran fine.
    I then updated the SQL Agent job to use an operating system command instead
    of a SSIS package on the job step.  This fails...
    The issue is definately with the SQL Server Agent

  • Sql server agent job failing to connect excel connection manager of SSIS package by 32-bit mode run time

    I am unable to succeed with sql agent job, I am trying to execute the SSIS package through sql agent job by ticking 32 bit runtime check box in 64 bit machine , even it does not worked..
    could any one helpme on this?
     Source: Excel Load Connection manager "Excel Connection Manager"    
    Description: SSIS Error Code DTS_E_OLEDBERROR.  An OLE DB error has occurred. Error code: 0x80040154.  An OLE DB record is available.  Source: "Microsoft OLE DB Service Components"  Hresult: 0x80040154  Description: "Class
    not registered".  End Error   TS_E_CANNOTACQUIRECONNECTIONFROMCONNECTIONMANAGER.  The AcquireConnection method call to the connection manager "Excel Connection Manager" failed with error code 0xC0202009.  There may be error
    messages posted before this with more information on why the AcquireConnection method call failed.  End...  The package execution fa...  The step failed.

    Hello Keerthi,
    Can you please modify settings and set delay validation for Excel connection manager? I think its validating connection and failing because it might be picking that from some variable.
    Alternatively, please run package using below and see what happens.
    EXEC master..xp_cmdshell 'DTEXEC.exe /SQL "Folder\Package" /SERVER Servername'
    I will recommend you to follow steps in below link.
    http://www.sqlhammer.com/blog/running-ssis-packages-in-32-bit/
    Regards,
    Vishal Patel
    Blog: http://vspatel.co.uk
    Site: http://lehrity.com

  • Will Sql Server Agent start job when previous instance is running?

    Just as an example, I have a job that is set to run every 5 minutes. The job takes 30 minutes to complete. So sql server agent executes the job at 9:30AM. Will the job run again at 9:35AM even though the previous instance hasn't completed?
    In my case, I would like to reproduce what Task Scheduler already has, which is to
    not begin a new instance until the previous instance has completed. When the previous instance completes, then 5 minutes later, the job will be run again.
    Thanks.
    VM

    Apparently, it will skip it until the job is completed: http://stackoverflow.com/questions/865042/will-a-sql-server-job-skip-a-scheduled-run-if-it-is-already-running
    VM

  • Article - LabVIEW-Based Utility to Package & Deploy MS SQL Server 2005 Express Edition Databases

    Anthony Lukindo, the newest ExpressionFlow blog LabVIEW community author, has just published the first part of his two-part blog article
    LabVIEW-Based Utility to Package & Deploy MS SQL Server 2005 Express Edition Databases - Part 1
    Please check it out!
    Tomi Maila

    Anthony Lukindo, the newest ExpressionFlow blog LabVIEW community author, has just published the first part of his two-part blog article
    LabVIEW-Based Utility to Package & Deploy MS SQL Server 2005 Express Edition Databases - Part 2
    Please check it out!
    Tomi Maila

  • ColdFusion and MS SQL Server 2005 Enterprise Edition

    Trying to get ColdFusion (Developers Edition) to communicate
    with MS SQL Server 2005 (Enterprise Edition). I have ColdFusion
    running on username = admin; password = as set up when installed.
    Have also tried setting up a user account with my Windows desktop
    username and password in case ColdFusion needed to be logged on as
    the same user as the SQL server. I have full admin permissions on
    the SQL Server (with Windows authentication), and am the database
    "owner" of the database on the server. In either ColdFusion login
    case, when I try to "add a data source", with driver = Microsift
    SQL Server, I get.....
    Connection verification failed for data source: CFtoVolcano
    java.sql.SQLException: [Macromedia][SQLServer JDBC
    Driver][SQLServer]Login failed for user 'kewing'.
    The root cause was that: java.sql.SQLException:
    [Macromedia][SQLServer JDBC Driver][SQLServer]Login failed for user
    'kewing'.
    Went to help files (troubleshooting area) and verified that
    the local web browser (IIS) and Cold Fusion ARE running. Next step
    takes me to "Change ColdFusion user account" which starts with
    "Open Control Panel and select ColdFusion 8 App Server and click
    Startup". I don't see that choice in MyComputer/ControlPanel. Not
    even sure if this is going to ba another dead end anyway!!!
    HELP! This shouldn't be this difficult! I'm not using some
    weird version of SQL!

    To use the default SQL drivers bundled with CF you need to
    use SQL authentication (which is disabled by default I think) in
    SQL Server 2005. If you enable SQL (mixed mode) authentication and
    create a user you can then add the data source in the CF admin.
    Alternatively, in order to use integrated windows
    authentication with SQL server your CF service needs to run as
    specific user. (It sounds like you've already done this) and you
    will need to use Microsoft's JDBC driver
    Driver download (MS JDBC Driver)
    http://www.microsoft.com/downloads/details.aspx?familyid=C47053EB-3B64-4794-950D-81E1EC91C 1BA&displaylang=en
    Connecting with Integrated authentication (MS JDBC Driver)
    http://msdn2.microsoft.com/en-us/library/ms378428.aspx#Connectingintegrated

  • Windows Server 2012 Essentials and Microsoft SQL Server 2014 Standard Core Edition

    Our company is planning to buy Windows Server 2012 R2 Essentials edition (Volume license) and install it on Citrix Xenserver based virtual machine with 4 virtual processor cores. Can we install Microsoft SQL Server 2014 Standard Core Edition (2 licenses
    for 2 cores) and run it on this virtual machine?

    you can install SQL Server Standard 2014/2012 on the Essentials Windows Server but without Server core Installation while installing SQL Server 2014 is supported on the Server Core mode of the following editions of Windows Server:
    Windows Server 2012 R2 Datacenter 64-bit
    Windows Server 2012 R2 Standard 64-bit
    Windows Server 2012 Datacenter 64-bit
    Windows Server 2012 Standard 64-bit
    Windows Server 2008 R2 SP1 Datacenter 64-bit
    Windows Server 2008 R2 SP1 Enterprise 64-bit
    Windows Server 2008 R2 SP1 Standard 64-bit
    Windows Server 2008 R2 SP1 Web 64-bit
    http://msdn.microsoft.com/en-us/library/ms143506.aspx
    thanks
    diramoh
     

  • Problem of Teststand3.1 database and microsoft SQL Server 2000 personal edition

    I have a problem when using teststand database function with Microsoft sql server 2000. the error(seen in attached screenshot3.jpg) is:
    "An error occurred calling 'LogResults' in 'ITSDBLog' of 'DBLog 1.0 Type Library'
    An error occurred executing a statement.
    Schema: Generic Recordset (NI).
    Statement: UUT_RESULT.
    [Microsoft][ODBC SQL Server Driver][SQL Server]unable to insert NULL value to column "ID", table "test.dbo.UUT_RESULT";This column is not alowed to be blank. INSERT Failed. Multiple-step OLE DB operation generated errors. Check each OLE DB status value, if available. No work was done.
    [Microsoft][ODBC SQL Server Driver][SQL Server]terminated.
    Source: TSDBLog"
     Here I listed my proceess.
    1, Configure in SQL Sever, please see attached screenshot0.jpg
       a, Open SQL
       b, build a new database with the name of test
       c, import the data from "C:\Program Files\National Instruments\TestStand 3.1\Components\NI\Models\TestStandModels\Database\TestStand Results.mdb"
    2, Configure Microsoft SQL sever: please see attached screenshot1.jpg
       a, Open windows Control Panel and select "Data Sources (ODBC). Under system DSN tab, add a SQL server data source
    3, Configure teststand database option, see attached screenshot2.jpg
       a, configure logging option, enable
       b, configure datalink
       c, select schemas of "Generic recordset (NI)
       d, No change on the tabs of "statements" and "Columns/Parameters"
    4, run an seqence file with the proess model of SequentialModel.Seq.
    Attachments:
    Screenshot.zip ‏425 KB

    Thanks Scott,
      The database function is OK now after I changed imported tables in SQL Sever.
      Actually, I once tried anothor method that you refered by using the scripts
    located at: <TestStand>\Components\NI\Models\TestStandModels\Database\SQL Server Create Generic Recordset Result Tables.sql. Attached is the error screenshots, please help me on this.
    Thanks
    Jacky
    Attachments:
    Error.jpg ‏59 KB

  • If I resize job history log to see more entries listed under job history, will cause sql server agent to restart or any downtime?

    Here is I am going to do:
    Using SQL Server Management Studio
    To resize the job history log based on raw size
    In Object Explorer, connect to an instance of the SQL Server Database Engine, and then expand that instance.
    Right-click SQL Server Agent, and then click Properties.
    Select the History page, and then confirm that Limit size of job history logis checked.
    In the Maximum job history log size box, enter the maximum number of rows the job history log should allow.
    In the Maximum job history rows per job box, enter the maximum number of job history rows to allow for a job.

    this change does not require SQL agent restart
    Please click the Mark as answer button and vote as helpful if this reply solves your problem

  • SSIS Package will only run as SQL Agent Job when I have remote desktop to server open.

    Hey guys, so I have another problem to add to the already massive 'SSIS/SQL Server Agent Job' pile. After days of searching, I can't seem to find anything specific to my problem though.
    The setup is as follows: a SSIS package that refreshes and saves excel files that are hosted on a server. The package runs fine on the local machine, using BIDS on the server, and will even work as a SQL Agent Job on the server IF there is a remote
    desktop connection to the server. To elaborate, if I simply run the job as you would normally do it will fail and give the below error. If I run the job while either myself, or a different machine, has a remote desktop connection to the server where the
    job is scheduled - it will run successfully.
    Below is the error from the History File of the job. Any help would be greatly appreciated.
      Source: Refresh Excel and Save      Description: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Runtime.InteropServices.COMException (0x8000401A): Retrieving
    the COM class factory for component with CLSID {00024500-0000-0000-C000-000000000046} failed due to the following error: 8000401a.     at ST_79772452677f4de1852d5ffbba3e5232.csproj.ScriptMain.ExcelRefresh(String FileName)    
    at ST_79772452677f4de1852d5ffbba3e5232.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()
    UPDATE:
    In my previous post the Identity in DCOM Config file for Microsoft Excel was set as The Interactive User. The job was working only when I had a remote connection to the server open.
    If I set the Identity to 'This User' and use the username and password of the server login account, it will work as a scheduled job without needing an open remote connection to the server. So it works, great! but I have reservations setting this
    for all instances of Excel for the server. I'm sure other users have different accounts they use for running Excel. Any suggestions around this?

    Hi LiamSexton,
    It should be the server-side Automation of Office issue described in the following KB article:
    http://support.microsoft.com/kb/257757 
    Microsoft does not currently recommend, and does not support, Automation of Microsoft Office applications from any unattended, non-interactive client application or component (including ASP, ASP.NET, DCOM, and NT Services), because Office may exhibit
    unstable behavior and/or deadlock when Office is run in this environment.
    User Identity: Office applications assume a user identity when the applications are run, even when Automation starts the applications. The applications try to initialize toolbars, menus, options, printers, and some add-ins based on settings in the user
    registry hive for the user who launches the application. Many services run under accounts that have no user profiles (such as the SYSTEM account or the IWAM_[servername] accounts). Therefore, Office may not initialize correctly on startup. In this situation,
    Office returns an error on the CreateObject function or the CoCreateInstance function. Even if the Office application can be started, other functions may not work correctly if no user profile exists.
    To work around the issue, you can refer to the following alternative introduced in the article:
    Most server-side Automation tasks involve document creation or editing. Office 2007 supports new Open XML file formats that let developers create, edit, read, and transform file content on the server side. These file formats use the System.IO.Package.IO
    namespace in the Microsoft .NET 3.x Framework to edit Office files without using the Office client applications themselves. This is the recommended and supported method for handling changes to Office files from a service.
    Regards,
    Mike Yin
    TechNet Community Support

  • SQL Server analysis service command does not retry in agent job

    Hello,
    I'm working on SQL Server 2008 R2 version. I have scheduled a SQL server agent job to process analysis service cube using an analysis service command. Sometimes this job fails due to network load. So I set this job to retry 2 times after 10 mins interval.
    There were no retry attempts when job failed. There was no error message.
    I simulated this scenario using simple analysis service command which I intentionally set to fail. That's right. It's not retrying for analysis service commands. Any workaround for this ? any suggestions ?
    Thanks in advance.

    Hi Anush87,
    In your scenario, you had set that the step to retry 2 times after 10 mins interval. However, there were no any retry attempts when job failed, and you can reproduce this issue, right?
    Since there is no any error message, it's hard to give you the root reason that cause this issue. Based on my research, so many other people had encountered this issue which you can see on the link below
    http://social.technet.microsoft.com/Forums/en-US/543acccb-f107-420b-9652-53856c9137bb/sql-server-agent-job-retry-not-working?forum=sqldatabaseengine, you can you can submit a feedback at the link below
    http://connect.microsoft.com/SQLServer/Feedback
    So that Microsoft will confirm that if this issue is a bug in SQL Server Agent job.
    However, in order to troubleshoot this issue, you can query Agent job information to ensure the job configure settings are correct, you can refer to the link below to check it.
    http://www.mssqltips.com/sqlservertip/2561/querying-sql-server-agent-job-information/
    http://www.sqlservercentral.com/blogs/hugo/2009/05/27/configuring-auto-retry-on-sql-server-agent/
    Hope this helps.
    Regards,
    Charlie Liao
    TechNet Community Support

  • 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

  • Wait on the Database Engine recovery handle failed. Check the SQL server error log for potential causes in SQL Server 2012 Developer Edition

    I m using SQL Server 2012 Developer Edition. Even I tried 2012 express and enterprise edition but all
    gave same error. I browsed msdn blog. But nothing help me out.
    Below is the error log details--
    Overall summary:
      Final result:                  Failed: see details below
      Exit code (Decimal):           -2061893606
      Start time:                    2013-10-21 12:58:05
      End time:                      2013-10-21 13:52:30
      Requested action:              Install
    Setup completed with required actions for features.
    Troubleshooting information for those features:
      Next step for RS:              Use the following information to resolve the error, uninstall this feature, and then run the setup process again.
      Next step for SQLEngine:       Use the following information to resolve the error, uninstall this feature, and then run the setup process again.
      Next step for DQ:              Use the following information to resolve the error, uninstall this feature, and then run the setup process again.
      Next step for FullText:        Use the following information to resolve the error, uninstall this feature, and then run the setup process again.
      Next step for Replication:     Use the following information to resolve the error, uninstall this feature, and then run the setup process again.
    Machine Properties:
      Machine name:                  CROY-TOSH
      Machine processor count:       4
      OS version:                    Windows 7
      OS service pack:               Service Pack 1
      OS region:                     United States
      OS language:                   English (United States)
      OS architecture:               x64
      Process architecture:          64 Bit
      OS clustered:                  No
    Product features discovered:
      Product              Instance             Instance ID                    Feature                
                     Language             Edition              Version         Clustered 
    Package properties:
      Description:                   Microsoft SQL Server 2012 Service Pack 1
      ProductName:                   SQL Server 2012
      Type:                          RTM
      Version:                       11
      SPLevel:                       0
      Installation location:         C:\Users\CRoy\Downloads\SQL Server 2012 Developer Edition (x86 and x64) - DVD (English)\x64\setup\
      Installation edition:          Developer
    Product Update Status:
      None discovered.
    User Input Settings:
      ACTION:                        Install
      ADDCURRENTUSERASSQLADMIN:      false
      AGTSVCACCOUNT:                 NT Service\SQLSERVERAGENT
      AGTSVCPASSWORD:                *****
      AGTSVCSTARTUPTYPE:             Manual
      ASBACKUPDIR:                   C:\Program Files\Microsoft SQL Server\MSAS11.MSSQLSERVER\OLAP\Backup
      ASCOLLATION:                   Latin1_General_CI_AI
      ASCONFIGDIR:                   C:\Program Files\Microsoft SQL Server\MSAS11.MSSQLSERVER\OLAP\Config
      ASDATADIR:                     C:\Program Files\Microsoft SQL Server\MSAS11.MSSQLSERVER\OLAP\Data
      ASLOGDIR:                      C:\Program Files\Microsoft SQL Server\MSAS11.MSSQLSERVER\OLAP\Log
      ASPROVIDERMSOLAP:              1
      ASSERVERMODE:                  MULTIDIMENSIONAL
      ASSVCACCOUNT:                  NT Service\MSSQLServerOLAPService
      ASSVCPASSWORD:                 <empty>
      ASSVCSTARTUPTYPE:              Automatic
      ASSYSADMINACCOUNTS:            CRoy-TOSH\CRoy
      ASTEMPDIR:                     C:\Program Files\Microsoft SQL Server\MSAS11.MSSQLSERVER\OLAP\Temp
      BROWSERSVCSTARTUPTYPE:         Disabled
      CLTCTLRNAME:                   ROY
      CLTRESULTDIR:                  C:\Program Files (x86)\Microsoft SQL Server\DReplayClient\ResultDir\
      CLTSTARTUPTYPE:                Manual
      CLTSVCACCOUNT:                 NT Service\SQL Server Distributed Replay Client
      CLTSVCPASSWORD:                <empty>
      CLTWORKINGDIR:                 C:\Program Files (x86)\Microsoft SQL Server\DReplayClient\WorkingDir\
      COMMFABRICENCRYPTION:          0
      COMMFABRICNETWORKLEVEL:        0
      COMMFABRICPORT:                0
      CONFIGURATIONFILE:             C:\Program Files\Microsoft SQL Server\110\Setup Bootstrap\Log\20131021_125116\ConfigurationFile.ini
      CTLRSTARTUPTYPE:               Manual
      CTLRSVCACCOUNT:                NT Service\SQL Server Distributed Replay Controller
      CTLRSVCPASSWORD:               <empty>
      CTLRUSERS:                     CRoy-TOSH\CRoy
      ENABLERANU:                    false
      ENU:                           true
      ERRORREPORTING:                true
      FEATURES:                      SQLENGINE, REPLICATION, FULLTEXT, DQ, AS, RS, RS_SHP, RS_SHPWFE, DQC, BIDS, CONN, IS, BC, SDK, BOL, SSMS, ADV_SSMS, DREPLAY_CTLR, DREPLAY_CLT, SNAC_SDK, MDS
      FILESTREAMLEVEL:               2
      FILESTREAMSHARENAME:           MSSQLSERVER
      FTSVCACCOUNT:                  NT Service\MSSQLFDLauncher
      FTSVCPASSWORD:                 <empty>
      HELP:                          false
      IACCEPTSQLSERVERLICENSETERMS:  false
      INDICATEPROGRESS:              false
      INSTALLSHAREDDIR:              C:\Program Files\Microsoft SQL Server\
      INSTALLSHAREDWOWDIR:           C:\Program Files (x86)\Microsoft SQL Server\
      INSTALLSQLDATADIR:             <empty>
      INSTANCEDIR:                   C:\Program Files\Microsoft SQL Server\
      INSTANCEID:                    MSSQLSERVER
      INSTANCENAME:                  MSSQLSERVER
      ISSVCACCOUNT:                  NT Service\MsDtsServer110
      ISSVCPASSWORD:                 <empty>
      ISSVCSTARTUPTYPE:              Automatic
      MATRIXCMBRICKCOMMPORT:         0
      MATRIXCMSERVERNAME:            <empty>
      MATRIXNAME:                    <empty>
      NPENABLED:                     0
      PID:                           *****
      QUIET:                         false
      QUIETSIMPLE:                   false
      ROLE:                          <empty>
      RSINSTALLMODE:                 DefaultNativeMode
      RSSHPINSTALLMODE:              SharePointFilesOnlyMode
      RSSVCACCOUNT:                  NT Service\ReportServer
      RSSVCPASSWORD:                 <empty>
      RSSVCSTARTUPTYPE:              Automatic
      SAPWD:                         *****
      SECURITYMODE:                  SQL
      SQLBACKUPDIR:                  <empty>
      SQLCOLLATION:                  Latin1_General_CI_AI
      SQLSVCACCOUNT:                 NT Service\MSSQLSERVER
      SQLSVCPASSWORD:                *****
      SQLSVCSTARTUPTYPE:             Automatic
      SQLSYSADMINACCOUNTS:           CRoy-TOSH\CRoy
      SQLTEMPDBDIR:                  <empty>
      SQLTEMPDBLOGDIR:               <empty>
      SQLUSERDBDIR:                  <empty>
      SQLUSERDBLOGDIR:               <empty>
      SQMREPORTING:                  false
      TCPENABLED:                    0
      UIMODE:                        Normal
      UpdateEnabled:                 true
      UpdateSource:                  MU
      X86:                           false
      Configuration file:            C:\Program Files\Microsoft SQL Server\110\Setup Bootstrap\Log\20131021_125116\ConfigurationFile.ini
    Detailed results:
      Feature:                       Management Tools - Complete
      Status:                        Passed
      Feature:                       Client Tools Connectivity
      Status:                        Passed
      Feature:                       Client Tools SDK
      Status:                        Passed
      Feature:                       Client Tools Backwards Compatibility
      Status:                        Passed
      Feature:                       Management Tools - Basic
      Status:                        Passed
      Feature:                       SQL Server Data Tools
      Status:                        Passed
      Feature:                       Reporting Services - Native
      Status:                        Failed: see logs for details
      Reason for failure:            An error occurred for a dependency of the feature causing the setup process for the feature to fail.
      Next Step:                     Use the following information to resolve the error, uninstall this feature, and then run the setup process again.
      Component name:                SQL Server Database Engine Services Instance Features
      Component error code:          0x851A001A
      Error description:             Wait on the Database Engine recovery handle failed. Check the SQL Server error log for potential causes.
      Error help link:               http://go.microsoft.com/fwlink?LinkId=20476&ProdName=Microsoft+SQL+Server&EvtSrc=setup.rll&EvtID=50000&ProdVer=11.0.3128.0&EvtType=0xD15B4EB2%400x4BDAF9BA%401306%4026&EvtType=0xD15B4EB2%400x4BDAF9BA%401306%4026
      Feature:                       Database Engine Services
      Status:                        Failed: see logs for details
      Reason for failure:            An error occurred during the setup process of the feature.
      Next Step:                     Use the following information to resolve the error, uninstall this feature, and then run the setup process again.
      Component name:                SQL Server Database Engine Services Instance Features
      Component error code:          0x851A001A
      Error description:             Wait on the Database Engine recovery handle failed. Check the SQL Server error log for potential causes.
      Error help link:               http://go.microsoft.com/fwlink?LinkId=20476&ProdName=Microsoft+SQL+Server&EvtSrc=setup.rll&EvtID=50000&ProdVer=11.0.3128.0&EvtType=0xD15B4EB2%400x4BDAF9BA%401306%4026&EvtType=0xD15B4EB2%400x4BDAF9BA%401306%4026
      Feature:                       Data Quality Services
      Status:                        Failed: see logs for details
      Reason for failure:            An error occurred for a dependency of the feature causing the setup process for the feature to fail.
      Next Step:                     Use the following information to resolve the error, uninstall this feature, and then run the setup process again.
      Component name:                SQL Server Database Engine Services Instance Features
      Component error code:          0x851A001A
      Error description:             Wait on the Database Engine recovery handle failed. Check the SQL Server error log for potential causes.
      Error help link:               http://go.microsoft.com/fwlink?LinkId=20476&ProdName=Microsoft+SQL+Server&EvtSrc=setup.rll&EvtID=50000&ProdVer=11.0.3128.0&EvtType=0xD15B4EB2%400x4BDAF9BA%401306%4026&EvtType=0xD15B4EB2%400x4BDAF9BA%401306%4026
      Feature:                       Full-Text and Semantic Extractions for Search
      Status:                        Failed: see logs for details
      Reason for failure:            An error occurred for a dependency of the feature causing the setup process for the feature to fail.
      Next Step:                     Use the following information to resolve the error, uninstall this feature, and then run the setup process again.
      Component name:                SQL Server Database Engine Services Instance Features
      Component error code:          0x851A001A
      Error description:             Wait on the Database Engine recovery handle failed. Check the SQL Server error log for potential causes.
      Error help link:               http://go.microsoft.com/fwlink?LinkId=20476&ProdName=Microsoft+SQL+Server&EvtSrc=setup.rll&EvtID=50000&ProdVer=11.0.3128.0&EvtType=0xD15B4EB2%400x4BDAF9BA%401306%4026&EvtType=0xD15B4EB2%400x4BDAF9BA%401306%4026
      Feature:                       SQL Server Replication
      Status:                        Failed: see logs for details
      Reason for failure:            An error occurred for a dependency of the feature causing the setup process for the feature to fail.
      Next Step:                     Use the following information to resolve the error, uninstall this feature, and then run the setup process again.
      Component name:                SQL Server Database Engine Services Instance Features
      Component error code:          0x851A001A
      Error description:             Wait on the Database Engine recovery handle failed. Check the SQL Server error log for potential causes.
      Error help link:               http://go.microsoft.com/fwlink?LinkId=20476&ProdName=Microsoft+SQL+Server&EvtSrc=setup.rll&EvtID=50000&ProdVer=11.0.3128.0&EvtType=0xD15B4EB2%400x4BDAF9BA%401306%4026&EvtType=0xD15B4EB2%400x4BDAF9BA%401306%4026
      Feature:                       Master Data Services
      Status:                        Passed
      Feature:                       Distributed Replay Client
      Status:                        Passed
      Feature:                       Distributed Replay Controller
      Status:                        Passed
      Feature:                       Integration Services
      Status:                        Passed
      Feature:                       Data Quality Client
      Status:                        Passed
      Feature:                       Analysis Services
      Status:                        Passed
      Feature:                       Reporting Services - SharePoint
      Status:                        Passed
      Feature:                       Reporting Services Add-in for SharePoint Products
      Status:                        Passed
      Feature:                       SQL Browser
      Status:                        Passed
      Feature:                       Documentation Components
      Status:                        Passed
      Feature:                       SQL Writer
      Status:                        Passed
      Feature:                       SQL Client Connectivity
      Status:                        Passed
      Feature:                       SQL Client Connectivity SDK
      Status:                        Passed
    Rules with failures:
    Global rules:
    Scenario specific rules:
    Rules report file:               C:\Program Files\Microsoft SQL Server\110\Setup Bootstrap\Log\20131021_125116\SystemConfigurationCheck_Report.htm

    Hi,
    This 3rd time I followed this link. But nothing new, same error.
    Can you please tell me how to do follow, I cannt do the 1st step, how to change the local system to windows level account, vice-versa. It is shown mine as
    Server Configuration Manager(Local) 
    From here I folllowed the steps ---[I cannt insert link/image :-(]
    SQL 2008/R2 setup fails with "Wait on the database engine recovery handle failed" 
    If I right clicked on SQL Server Service, there is no option to change the account. 
    Hello,
    Thanks for your patience,did you tried stesp mentioned in below article
    http://blogs.msdn.com/b/sqljourney/archive/2012/03/16/sql-2008-r2-setup-fails-with-quot-wait-on-the-database-engine-recovery-handle-failed-quot.aspx
    To resolve it, follow these steps:-
    When the installation throws this error, click on OK and allow it to proceed. It will fail for Database Engine, but the SQL Server service should have
    been created. Check the Services console.
    If the service is present, perform the following steps:-
    1. Go to SQL Server Configuration manager, right click on the SQL Server service, and change the service account (if it is local system, give
    it a windows level account, and vice-versa). It might throw a WMI error but you will see the account getting updated anyway. If not, then use the Services console. Change the account for SQL Agent as well.
    Use this link to change sql server service account
    http://technet.microsoft.com/en-us/library/ms345578.aspx
    2. Next, try to start the service. It should come online.
    3. However, you will not be able to log in to the SQL Server
    4. Now stop the service and start it from the command prompt using -m -c -T3608 parameters.
    5. Now try logging in to the server using admin connection from sqlcmd (sqlcmd admin:<server name>\<instance name> ...)
    6. Once logged in, use the sp_addsrvrolemember '<domain\username>','sysadmin'.
    Also add the builtin/administrators to the sysadmin role
    7. Now stop the service from the command prompt and start it from SQL Server configuration manager
    You should be able to log in to the server now.
    Hope this helps someone.
    Please revert if it helps or even if it does not
    Please mark this reply as the answer or vote as helpful, as appropriate, to make it useful for other readers

Maybe you are looking for

  • Mac Mini DVi on HDTV - PROBLEM

    hey all, i am using a mac mini (1.42 G4 80gb 512 combo) on a sharp HDTV using a DVI to HDMI cable. everything works but i have a problem that it is slightly blurred, this makes text (especially small fonts) very difficult to read. is there any way to

  • TV-out problem Geforce 4 MX440 in Windows XP

    I have a serious problem with Windows XP Professional and Geforce 4 MX440SE-T. I use an Athlon XP 1800+ Palomino, MB ASUS A7S333. Windows 2000 and XP In window "video properties", occur an error in the MSI tabs. The even occur on Windows 2000. In the

  • Why its showing error : Invalid Object Name 'table name' when we try to insert data ?

    Hi,     When i try to insert data in the database with the following query                 con.Open();                 cmd = new SqlCommand("insert into good(ID,Name) values('" + textBox1.Text + "','" + textBox2.Text + "')", con);                 cmd

  • WAAS Application Requests - Process Question

    Non Technical Process Question We all have forms we have our users complete when a firewall rule or change is needed.  You may even have a similiar documents for when load balancers or DNS changes are required.  Does anyone have document they can sha

  • IWeb and personal domain

    Is it possible to create a website using iWeb and upload it to personal domain (www.mydomain.com) without Mobile Me?