Posts Tagged ‘database files’

Get a list of all your database files

I needed a list of all the database files on a SQL Server instance. Here’s how to get this easily. First create a temp table to hold the data like so.. ?View Code TSQLSELECT * INTO #db_files FROM sys.database_files; Truncate it so we don’t duplicate nay data. ?View Code TSQLTRUNCATE TABLE #db_files; Next we use […]