Maintenance and Management

Auto Auditing on Tables

  • Script

This is something that I find very useful and saves me a lot of time.This procedure needs to be created on the Database that holds the table that you wish to Audit. This procedure when called will create an audit table based on your source table in a database of your choice. All update/delete and […]

4.75 (8)

2007-10-03 (first published: )

9,044 reads

Monitor Database Growth

  • Script

This code provides a way of monitoring the growth of all your databases within a single instance. The first part is the creation of a monitoring table with the initial load of current databases and sizes. The second part is the SQL that can be put in a scheduled job to automate the growth monitoring.It […]

4.84 (19)

2007-05-16 (first published: )

24,330 reads

Mirroring Job Switcher

  • Script

I wrote this so that jobs associated with a mirrored database will run on the principal and not on the mirror.  Please send your comments on what implications I might be missing - I would appreciate that greatly.This procedure works in conjunction with a WMI alert you will setup in SQLSEVERAGENT -> Alerts ->Mirroring Status […]

2007-09-04 (first published: )

458 reads

Refreshing Views and Recompiling Stored Procs

  • Script

When a table is modified by changing the order of fields or changing field type or adjusting field sizes etc, some of the dependent views (or views on views on views :)) may become invalid as they store some metadata in order to run more efficiently. These views would need to be refreshed with new […]

4.86 (7)

2007-04-20 (first published: )

1,764 reads

Audit SQL Logins

  • Script

We have auditors in the building, looking at our security (amongst other things). So, we needed an easy way to generate a listing of the SQL logins, and the permissions into each database on our servers (over 70 if them).This script will generate the listings the auditors wanted.

5 (9)

2007-04-02 (first published: )

5,573 reads

Easily Kill All Users In A Database

  • Script

This simple script (ran from the master database) in Query Analyser removes all the requirements of collating currently connected spids to a database and the need to systematically open a cursor to kill each spid individually by simply placing the database offline, then immediately online.

2 (1)

2007-03-16 (first published: )

359 reads

Blogs

Information Measurement with SQL Server, Part 4.9: The Bregman Divergence

By

By Steve Bolton …………Before closing out this long-delayed segment on stochastic information distances, I...

Let’s Talk About The Cloud

By

I’m launching a new initiative called the Community Circle Cloud Conversation Club (c5 for...

Daily Coping 29 May 2020

By

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

Read the latest Blogs

Forums

Daily Coping 29 May 2020

By Steve Jones - SSC Editor

Today’s tip is today link your decisions and choices to your purpose in life....

Week Ending Thursday, can some one tweek my code?

By bark01

What I have missed from this code? I'm trying to show the DateTimeRaised field...

The Matchbox Database

By Phil Factor

Comments posted to this topic are about the item The Matchbox Database, which is...

Visit the forum

Ask SSC

SQL Server Q&A from the SQLServerCentral community

Get answers