Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
Log in  ::  Register  ::  Not logged in

Get your favorite SSC scripts directly in SSMS with the free SQL Scripts addin. Search for scripts directly from SSMS, and instantly access any saved scripts in your SSC briefcase from the favorites tab.
Download now (direct download link)

Display Names and Locations of SQL Database Files and DB Owners

By Charles Brinkman,

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.

Total article views: 1498 | Views in the last 30 days: 4
Related Articles

List Database Users and their Corresponding Roles

Database Users and their Corresponding Roles and type login.


Application Developers don’t own their data

As a data guy, I always smile when application developers refer to ‘their’ data. If only it were tha...


Listing Subscribed SSRS Reports including Parameters & their Values

This script will allow user to analysis their Subscribed Reports.


Microsoft Changing Their Lifecycle Support Policy

Microsoft’s Bob Ward has a new post up on the CSS SQL Server Engineers blog about a change in their....


Going over their heads: IT Decisions

Phil factor points out that Marketing people who appeal directly to enterprise CIOs are generally wa...


Join the most active online SQL Server Community

SQL knowledge, delivered daily, free:

Email address:  

You make SSC a better place

As a member of SQLServerCentral, you get free access to loads of fresh content: thousands of articles and SQL scripts, a library of free eBooks, a weekly database news roundup, a great Q & A platform… And it’s our huge, buzzing community of SQL Server Professionals that makes it such a success.

Join us!

Steve Jones

Already a member? Jump in:

Email address:   Password:   Remember me: Forgotten your password?
Steve Jones