sql-agent-job

what is the best way to run Sql Agent job using C#?

僤鯓⒐⒋嵵緔 提交于 2020-01-03 04:47:29
问题 I am using Sql server 2005 and using C#/Asp.Net 4.0 for UI. I want to trigger the sql job from an user action in a webpage. I need to keep checking job's status while its running. There are several old threads on this issue which gets the status of the jobs (How to monitor SQL Server Agent Job info in C#) but i need my program should be able to Run,Stop,Enable,Disable the jobs I need the below functionality in my UI. Check the status of a sql job Run the specified job Stop the job Disable

Microsoft Excel cannot access the file on Windows Server 2012

烈酒焚心 提交于 2019-12-31 03:33:09
问题 I am running an SSIS Package that contains a C# Script which formats an Excel File on Windows Server 2012 R2 . When I run the package it gives me this error Microsoft Office Excel cannot access the file '\\FolderPath\FilePath' I have seen this question Microsoft Office Excel cannot access the file 'c:\inetpub\wwwroot\Timesheet\App_Data\Template.xlsx' and have checked my permission's and they are correct. I also tried to add Double Quotes around the final FilePath like this sFile = "\"" +

SSIS package - Script task does not get executed when triggered through SQL Job Agent

為{幸葍}努か 提交于 2019-12-23 22:32:54
问题 I have an SSIS package that creates 2 text files using a data flow component. It connects to an SQL database and if the query returns data, the 2 files are created. After that, a script task loops through the folder where the 2 files are written into, determines the oldest file and moves it to another folder. Everything moves smoothly when I execute the package on the server. No errors and all functions are executed. Perfect. However, when I schedule the SSIS package in a job, the said script

SQL Server Agent not starting automatically on server reboot [closed]

半城伤御伤魂 提交于 2019-12-23 10:18:59
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 5 years ago . I have noticed that SQL Agent does not start automatically after a reboot/shutdown on a few of our servers (SQL server starts up fine). The service is set to automatically start in windows. When we start SQL agent manually, it starts fine. 回答1: Add your windows level user in following path: Click on Start - Run

SQL Server Agent - get my own job_id

不问归期 提交于 2019-12-23 09:33:47
问题 I'm running a SQL Server 2008 64 bit Developer Edition with Service Pack 1 installed. I have a SQL Server Agent Job. Within this job I want to get the job_id of my own job. On MSDN (http://msdn.microsoft.com/en-us/library/ms175575(v=SQL.100).aspx) you can find a description of using tokens in job steps. Wow, great, that's what I'm looking for!! Just use (JOBID). Since SQL Server 2005 SP1 you have to use macro like $(ESCAPE_NONE(JOBID)). No problem. But if you try the example: DECLARE @name

Using a variable to process all *.xml files using SSIS

断了今生、忘了曾经 提交于 2019-12-22 18:10:04
问题 I am new to SSIS package, so any help would be really appreciated. The SSIS code was built using the VS2005 and its setup as a SQL agent Job in the 2005 SQL Server. Now as we are migrating to 2016 SQL server we see that the same SQL agent Job fails. Hence we decided to rebuild the package using VS2012, to see if that would solve the issue. Processes done on the Control Flow Tab: Data Flow task: Variables used: we have used a ForEachLoop: Errors Show in the Data Flow Task: We are still not

SSIS 2012 SQL Agent Job ConnectionString vs InitialCatalog

岁酱吖の 提交于 2019-12-22 08:37:13
问题 I was not able to find a resource discussing this from the SQL Agent and SSIS Catalog. I'm getting behavior that was unexpected when running a package from SQL Agent. I believe that the issue is that I specified a different InitialCatalog property in the sql agent configuration than I used in my connection string environment variable. Here you can see my connection string is different. I was expecting that the ConnectionString would override the InitialCatalog, but it does not seem to be the

SQL Server Agent Job Running Slow

廉价感情. 提交于 2019-12-21 04:42:31
问题 I am executing a stored procedure using SQL Server Agent Job in SQL Server 2005. This job was running fast until yesterday. Since yesterday this job is taking more than 1 hour instead of 2 mins. I executed the stored procedure in SSMS, it just took less than 1 minute to execute. I could not figure out why it is taking more than 1 hour when executed as a SQL Server Agent job? 回答1: After some time commenting and assuming that the SP performs with the same input parameters and data well when

Windows Event Log Access from SSIS package run in SQL Agent Job

烂漫一生 提交于 2019-12-11 23:41:57
问题 I have created an SSIS package that will be deployed to client SQL installations (2005, 2008 or 2008 R2) to perform data extracts which provide a support tool for our product. The deployment process requires that a Windows AD account (normal user, no elevated privileges) is created as this is used as a service account to execute the SSIS package in a SQL Agent job by way of a credential and a proxy account. This all works perfectly and means I can restrict the privileges required to perform

Executing SSIS package as SQL Job Agent failed - returns DTSER_FAILURE (1)

半腔热情 提交于 2019-12-11 04:31:57
问题 In this Job - SSIS is used for converting a table data into excel file . It is converting the table data into excel file successfully but still it is showing as Job failed . The following is the message shown in job history Microsoft (R) SQL Server Execute Package Utility Version 10.0.1600.22 for 32-bit Copyright (C) Microsoft Corp 1984-2005. All rights reserved. Started: 4:30:26 AM Error: 2014-05-01 04:30:33.68 Code: 0xC0202009 Source: Data Flow Task 1 Destination - po_list_tmp [79]