Shrink DBs - Job Script

I'm posting this job script because it gets used by my scheduler script. It simply enumerates through each database on the server, and then executes a DBCC SHRINKDATABASE. The only wrinkle here is that I have it do a quick check to make sure that certain jobs are not already running.

2002-01-04

1,136 reads

Transaction Logs - Job Script

I've included this job script, because it is used by the scheduler scripts that I've also posted. This job is a little more involved than most may need... It first checks to see if certain jobs are running. Is so, it waits for a while, and then checks again. After that it drops the existing […]

2002-01-04

1,096 reads

Check Jobs Current State

I created this script in an attempt to better automate many different jobs that run each morning, as part of a datawarehouse build. I use it to not only tell me what jobs are currently running (so that I can manage how many I would like to run at a time), but what happened to […]

5 (2)

2002-01-03

1,240 reads

Blogs

How to put a SQL Server Database into Recovery Pending

By

You might be asking why on earth would you want to get a database...

Daily Coping 30 Jul 2021

By

I started to add a daily coping tip to the SQLServerCentral newsletter and to...

SQL Server on Linux Storage Secrets on Microsoft Channel 9

By

I’m thrilled to have recently released a video with Microsoft’s Data Exposed on Channel...

Read the latest Blogs

Forums

Having sum(amount) = 0 returns negatives as well.

By C-M-A

Hello all, I'm trying to get a list of ID's that have a total...

How to limit SQL Job Success events

By Graham Van der vaart

Hi, We have a monitoring tool that reads Windows Event Log entries for Failure...

SQL Server Agent producing unreproducible error

By Thom A

I've built a Powershell script, which I want to run through SQL Server Agent....

Visit the forum

Ask SSC

SQL Server Q&A from the SQLServerCentral community

Get answers