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

Display Names and Locations of SQL Database Files and DB Owners

By Charles Brinkman, 2012/08/20

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: 1250 | Views in the last 30 days: 23
 
Related Articles
SCRIPT

List Database Users and their Corresponding Roles

Database Users and their Corresponding Roles and type login.

SCRIPT

Listing Subscribed SSRS Reports including Parameters & their Values

This script will allow user to analysis their Subscribed Reports.

BLOG

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....

ARTICLE

Moving Your Users with Their Databases

SQL Server 2000 databases seem to move more often than their DBAs would like. However, moving the lo...

FORUM

Script tables but why not include their non-clustered indexes ?

Script tables but why not include their non-clustered indexes ?

Tags
 
Contribute

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
Editor, SQLServerCentral.com

Already a member? Jump in:

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