Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 337347
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T10:19:39+00:00 2026-05-12T10:19:39+00:00

Using MS SQL Server 2005. On one of our servers we’re running out of

  • 0

Using MS SQL Server 2005.

On one of our servers we’re running out of room, so I’m going through the databases, shrinking, removing, backuping etc.

The largest file in the Data directory (an .mdf no less, not a .ldf) is not named according to our common naming-convention (it should reflect the database’s name). I cannot move the file, so I know it’s in use, but I have no idea which database uses it.

Is there a way of figuring this out other than traversing the many, many databases on this server?

I tried

SELECT * FROM sys.database_files

But that just gave me the files in use by the Master database.

Edit
I kept looking, and found the following:

SELECT * FROM sys.sysaltfiles

This lists the filenames and the names of the files in the context of the server. It also lists the dbid, but this does not seem to be the same as the database_id in sys.databases.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T10:19:39+00:00Added an answer on May 12, 2026 at 10:19 am

    You get the files in use by the Master database since you have selected the master as your current database. If you don’t have that many databases, you can traverse all databases manually and do the select on them.

    Try

    SELECT * FROM sys.master_files
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I arrived at work to today to discover one of our SQL 2005 servers
I am using SQL server 2005. In one of the tables, I have a
Using SQL Server 2005 and Management Studio how do I insert a picture into
When using SQL Server Management Studio from SQL Server 2005, I can connect to
I am using SQL Server 2005. I have a table with a text column
I'm using SQL Server 2005, and I would like to know how to access
We are using SQL Server 2005, but this question can be for any RDBMS
We're using SQL Server 2005 in a project. The users of the system have
I am using sql server 2005. I just want to know is there something
I am using SQL Server 2005. I want to constrain the values in a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.