sql-server-agent

How to backup SQL Server Agent jobs?

How can I backup and restore SQL Server 2005 Agent job schedules? ...

how to execute a stored procedure in a SQL Agent job?

I am using SQL Server 2008 and I need to run a SQL Job from SQL Server Agent. I am new to SQL Server Job and I want to execute a stored procedure regularly from a SQL Server Job. But I did not find where to specify the executed stored procedure other than copy & paste SQL commands. Here is my screen snapshot, Any ideas how to assign ...

Any solutions to test SQL Agent Job immediately to ignore schedule

Hello everyone, I am using SQL Server 2008 and I want to test the execution correctness of my SQL Server Agent job immediately to ignore the schedule. Any ideas? thanks in advance, George ...

how to record both success and fail in SQL Server Agent Job

Hello everyone, I am using SQL Server 2008 and I am writing a SQL Server Agent Job. In my Job, there are 3 steps and in each step I will execute a store procedure. I noticed that in default Notification setting, it write information to Windows event log only when it fails. My question is, any easy solutions to write both success and fa...

SQL Server agent job account issue

Hello everyone, I am using SQL Server 2008. I am confused about which account will be used when a SQL Server agent job runs. My confusions are, SQL Server agent as a Windows Service which we could control from Windows Service Management Console, from there we could set the account to run SQL Server Agent (LocalSystem in my computer); ...

How to start SQL Server agent jobs automatically

Hello everyone, I am writing PowerShell scripts to control SQL Server agent start/stop to ensure all the contained jobs runs according to defined schedule. I want to make sure that the only thing I need to do is to start the SQL Server Agent Windows Service, and then all the contained SQL Server Jobs will run automatically according to ...

Create SQL Server job automatically

Hello everyone, I am writing SQL Server deployment scripts which create SQL Server job automatically on a specific SQL Server server/instance. I have found that I can extract the sql statement which can be used to create SQL Server job automatically by using script job as => Create To. My confusion is that, I find the database name and...

strange scripts generated by SQL Server when exporting a job

Hello everyone, I am using SQL Server 2008 Enterprise. I am using Management Studio -> Jobs -> Script Job as -> Drop and Create TO feature to generate related sql statement so that from another computer I can import the job. My question is, from the generated sql scripts, from the beginning there is output like this, there is a hard co...

Looking for T-SQL scripts to delete a SQL Job

Hello everyone, If I know the database server name, instance name and the SQL Server job name, how to delete a SQL Server job by its name in a simple way? I am writing scripts which will be called by sqlcmd to delete SQL jobs. Appreciate if anyone could show me a sample? :-) thanks in advance, George ...

SQL Server add job agent T-SQL script issue

Hello everyone, I am using SQL Server 2008 Enterprise. I have created a very simple test SQL Server Agent job which just print out a string. And then I add a schedule to let the job run once a day. Then I select from SQL Server Management Studio => Jobs => Select the test job => Script Job as => Drop and Create To, here is the generate...

Could not obtain information about Windows NT group user

I am creating a SQL Server Replication using a script. When I try to execute The job failed. Unable to determine if the owner (STAR\moorer7) of job L3BPT2M-Atlas-14 has server access (reason: Could not obtain information about Windows NT group/user 'STAR\moorer7', error code 0x5. [SQLSTATE 42000] (Error 15404)). This is a job created...

Can you run an SSIS task from .net?

I have scheduled sql agent task which runs an SSIS package. I want to be able to run the SSIS package from .net. Is there a way to either run the SSIS package directly or at least run the SQL agent task which would in turn run the SSIS package. If it helps it is for a .net 3.5 web app written in C# Thanks! ...

Begin and monitor progress on long running SQL queries via ajax

Is it possible to start a query that will take a significant amount of time and monitor progress from the UI via Ajax? I considered starting the process as a "run once" job that is scheduled to run immediately. I could store the results in a temporary table for quick retrieval once it's complete. I could also log the run time of the rep...

How do I create a SQL Server agent without using a GUI?

I am using Angel LMS and its built on a SQL Server platform. I believe its 2005, but not 100% sure about that. Anyway, maybe my pseudo-code will shed light on that answer. Also single quotes must be used for strings and the concatenate character is +. I need to have something run 2-5 times a day (the frequency is not determined yet...

Calling SSIS that uses a DLL with SQL Server Agent requires the DLL to be installed on the calling machine and not the machine where pacakge is installed

We have a SSIS 2005 package that is installed on a central server and is called from multiple locations. This package uses a script task to call a .NET DLL which I wrote in c# and installed into the GAC on the central server. When I call the SSIS package from that server on which the package is installed everything is fine. When I call ...

Sending Notifications from a SQL Server 2000 Job without SMTP Server on the Box

I have SQL Server 2000 installed on Windows 2003 Server. We do not have SMTP installed on the box, so when creating a notification for a failed SQL Agent job, the email is not sent. Is there a way to send out a notification without installing SMTP on the box? ...

SQL Server: should I use an "Agent Job" or a "Maintenance Plan" to delete old data?

I'm looking for a way to periodically (e.g. weekly) run some SQL statements in a database to delete old data. As far as I can see, there are (at least) two ways to do this: using a "Maintenance Plan" and a "Execute T-SQL Statement Task" using an "SQL Server Agent Job" and specify the statements in a "Step" of that job My question is:...

SQL Server Agent Job Timeout

I have just had a scheduled SQL Server job run for longer than normal, and I could really have done with having set a timeout to stop it after a certain length of time. I might be being a bit blind on this, but I can't seem to find a way of setting a timeout for a job. Does anyone know the way to do it? Thanks ...

Using an SQL Agent Job to call procedures in a loop

Hello all, I am putting together a job on SQL Enterprise Manager 2000 to copy and delete records in a couple database tables. We've run a straight up mass copy and delete stored procedure, but it could be running it on millions of rows, and therefore hangs the server. I was interested in trying to run the service in 100-ish record chunk...

unable to start sql 2005 on windows 2003 two node cluster

SQL server Agent is not starting...... In the SQLAGENT log i found this error....... 2009-10-24 22:49:36 - ? [393] Waiting for SQL Server to recover databases... 2009-10-24 22:49:40 - ! [298] SQLServer Error: 5845, Address Windowing Extensions (AWE) requires the 'lock pages in memory' privilege which is not currently present in the ac...