0
votes
1answer
26 views

Script to Add a Job to a SQL Server DB

I want to add a job to my DB to make a back up weekly but i want to do it from an script, i've serched and with what i found i made this: CREATE SCHEMA job go CREATE PROC BACKUPS @dir varchar(max) AS ...
0
votes
0answers
47 views

SQL Server Agents Jobs failed when executed on schedule but succeeds when executed manually

I have a SQL job running an SSIS Package. This job can run manually but failed to run on schedule. The below is the error message generated. Any help will be highly appreciated. Code: 0x4004300A ...
3
votes
1answer
205 views

Allow non-sys admin, non-owner of a job to execute it

I have a job that runs an SSIS package. Currently the owner is a proxy account. I can run the job manually from a sys-admin account. Our web service logs in using a limited account. It needs to ...
0
votes
1answer
77 views

How to run SQL Job only on primary replica in AlwaysOn Availability Groups? [duplicate]

I have SQL Jobs that need to only on primary replica on AlwaysOn Availability Group. When jobs were originally created ServerA was primary, at later point ServerB became primary so jobs that were on ...
1
vote
2answers
567 views

deleting large volumes of rows from table efficiently in SQL Server [duplicate]

I have a table that has gotten a little out of control. I am not a DBA per se but seem to recall that deleting a huge volume of rows in one shot can cause transaction log issues, hamper overall system ...
1
vote
1answer
138 views

SQL Server Agent cannot log on to “MyServer”

I'm struggling to get our SQL Server Agent to run a maintenance plan, which used to work in the past. (This is on SQL Server 2008 R2.) The original problem was that the SQL Server Agent would not ...
3
votes
1answer
77 views

SQL server job has not run and also no entry logged in its history

I have scheduled a SQL job to run daily at 3am in the morning which creates a batch. It has not run today and i am also not able to fathom what's the reason behind its failure. There is no entry in ...
2
votes
1answer
27 views

Running members of a job subset at different intervals

So I'm wanting to batch a number of stored procedures into one job and would like a number of the procedures to run on a schedule different than that of the main job without setting up a new job for ...
5
votes
1answer
223 views

Schedule Query and Export

Is it possible, to schedule a simple Query to run Daily and export the received data into an excel file?
-2
votes
1answer
435 views

How to run steps in one job sequentially [closed]

I have one job on SQL server Job Agent that has 3 steps. I want to the job to run starting with step one. After step one is complete and only when it completes I want step 2 to start running and so ...
0
votes
3answers
1k views

SQL agent job step's connection managers

Is there any way with T-SQL to list the connection managers that are used in an SQL Agent Job step?
4
votes
2answers
319 views

Update strings for all cmdexec Jobs

Does anyone know if it's possible, (and furthermore advisable) to update all cmdexec strings in jobs on a server? We'd like to change our logging location, and in principle I'd think this could be ...
3
votes
1answer
103 views

Creative workaround for granting edit rights to individual jobs for a group?

We have two developers that say they can not function without full rights to a few jobs on our database server. They both want rights to the same jobs. Given that it seems that MS doesn't seem to be ...
2
votes
0answers
1k views

How to find when last reindexing happened in sql server? [closed]

I have set 'job' for re-indexing, I want to know when the last re-indexing happened in datetime.
2
votes
0answers
151 views

Configuring SQL Server Job agent

I am trying to configure the SQL Server Job Agent using the following scripts USE [msdb] GO CREATE USER [mydbuser] FOR LOGIN [mydbuser] GO EXEC sp_addrolemember N'db_datareader', N'mydbuser' GO EXEC ...
4
votes
2answers
3k views

Transaction and Try-catch in SQL Server Job

We have DML operations in each step of a SQL Server job. To ensure the update/insert will be rolled back in case something goes wrong, I have wrapped the data modifications of each step in TRY CATCH ...
0
votes
1answer
284 views

SQL Server Job logging best practice

To be able to design a robust Job in SQL Server, we need to have log for each step of the job. I know there are different options available which help us for troubleshooting a job, but what if we want ...
8
votes
2answers
523 views

How does SQL Server store the information in Job Schedule Properties?

I know there is SELECT * FROM msdb..sysjobschedules, but that just shows the next time a job is scheduled to run. I want to know how this is all determined and stored. So where does it store the ...