Computize! Consulting, Inc.  Business Intelligence Consultants Computize! logo text

SQL Server Scripts

We've used these for administration at a number of client sites. Try them out,
then come back and leave us some feedback using the buttons under the script titles.

Twitter T

Follow us on Twitter for updates on new scripts.

Store Activity Monitor Data
This proc will capture a snapshot of all the connections to your SQL Server at the time that it runs. Execute this as a job when an alert fires, and you'll have the user connection context for when something went wrong on your server. (Suggested job and alert creation are included in the script.) Two versions provided- one that includes the last command each connection ran, and one that doesn't.

Update Statistics By Age
Download this stored procedure that finds tables whose statistics are older than your given threshhold and then updates them. Versions for SQL 2012 and 2008 are both included in the .zip file.

Auto Rebuild Indexes (v.2012)
Stored procedure for SQL Server 2012 that finds and automatically rebuilds indexes fragmented beyond a percentage that you supply as a parameter. The parameterized SSRS 2012 report lets you request the rebuild history by date.

Job Summary
Stored procedure and SSRS report (2005 & 2008) showing time, duration and status for all SQL Server jobs that ran between date parameters you supply.

ReIndex Tables That Need It
Have your SQL Server figure out which tables & indexes need to be defragmented the most, and then take care of them for you. (For SQL Server 2005 & 2008.)
Included is an SSRS 2008 report to display a history of everything the proc did.

DB Size History
Schedule this stored proc regularly to log the history of your database(s') size, then use the included SSRS 2008 dashboard report to quickly track the growth of your data and log files, or see a snapshot of all your current databases' sizes. (2012 report coming soon.)

DDL Log
Create an automatically-updated log that stores a history of all new, changed, and dropped objects on your database.The download includes an SSRS 2008 report listing all DDL activity between dates you specify.

All Object Permissions
Quickly list all objects in your database and their permissions, with parameters to select object type, object, or permission to summarize. Includes an SSRS 2008 report letting you choose those parameters interactively.


© Computize! Consulting, Inc.