Site Search:
Sign in | Join | Help

SQL Server (T-SQL)

Comments and notes on SQL Server 2000, 2005, and T-SQL

Query to get the names and locations of SQL logs and database files

I have occasion to look at large servers, and as part of that process I need to look at all the files to see if they're ok, I'm particularly interested in the size of the log files (we might need to shrink them)

 This query will quickly show you where they all are

 select db.name , a.filename,a.size, a.*
 from sysdatabases db
  join sysaltfiles a on a.dbid = db.dbid

Comments

No Comments

About Steve Gray

Steve is a seasoned (translate: old) developer in VB and ASP.NET. He spends most of his time in Dynamics GP, writing custom mods for consulting firms. Crystal reports, eConnect, VS Tools for Dynamics... anything that comes along.