As part of maintaining shared development servers, I frequently check that users aren’t placing SQL database files in places where they shouldn’t be (restricting this through the file system isn't practical since this is a sandbox). I came up with the script below which displays the names of all of the SQL databases on a SQL Server instance, their data and transaction log files, their owner, and their physical location. I hope that this will be helpful to anyone who finds themselves in a similar situation.
Help! My Database is Marked Suspect.
If your database is marked suspect, this will show you a step-by-step guide in how to fix the problem.
2007-09-22 (first published: 2004-03-31)
59,162 reads