Monthly Archives: May 2010

What is a Good Way to Run CheckDB on a VLDB?

Today’s script is one that I wrote based on the logic outlined in a post by Paul Randal. This script is written for SQL 2000 but, as Paul notes, the logic will work on SQL 2005. Continue reading

Posted in Utilities | Tagged | Leave a comment

How Do I Move SQL Database Files Around?

Here is a script that will generate a script to move database files around in SQL 2005/2008. Continue reading

Posted in Utilities | Tagged , , , , , , | Comments Off

Where Do I Start with PowerShell?

This morning I set out to get some information about getting started in PowerShell for a coworker. Rather than spend a bunch of time searching for different sites I threw the question out to the SQL Community on Twitter via #SqlHelp. The response was so overwhelming that I decided I at owed it to the SQL Community to get it all written down. Continue reading

Posted in PowerShell | Tagged | Leave a comment

How Can I Tell if SQL Agent is Running via SQL?

Today’s post is a continuation in my on-going effort to document all of the scripts I use to manage my environment. To date it has been a great exercise both in getting things written down and in getting feedback from others on better ways I could be doing things. To that end, here is a stored procedure that I use to tell if SQL Agent is running before trying to start a job programmatically. Continue reading

Posted in Utilities | Tagged | Leave a comment

What is a Good Way to Get the SQL Server Log Directory?

The script for today is one that I use in all of my job creation scripts as well as a script I have to go back and clean up job output file paths. It gets the location of master on a SQL 2005 or SQL 2008 server, using that to find the Log directory. Continue reading

Posted in Utilities | Tagged | Comments Off