I run across this from time to time and can never remember the specifics, so I figured I'd document it here:
To move a SQL database from one drive to another drive (or just move it to a new folder):
Inside of Microsoft SQL Management Studio execute this script (of course, replace "NameOfDatabase" with the real database name):
Copy the database (usually NameOfDatabase.MDF and NameOfDatabase_log.LDF, assuming they haven't been renamed) to the new location. NOTE: The paths are relative to the server SQL Server is running on.
To move the TempDB system database to a new location:
Restart SQL Server for the changes to take effect. One it's restarted you can delete the tempdb.mdf and templog.mdf from the old location.
Some instructions for shrinking the tempdb database:
http://support.microsoft.com/kb/307487
Remember Me
a@href@title, b, i, strike