June 14, 2006 at 3:04 am
Hi,
I have found a script that returns a complete list of databases from a server but how do I get it to return the file path of the database also?
Please help!
June 14, 2006 at 8:49 am
David,
select * from sysdatabases
will return you a lot of info including FilePath. But this path is only for the primary file. All other file locations: for the log files, for the secondary data files is in the sysfiles table in each database.
Regards,Yelena Varsha
June 14, 2006 at 9:58 am
sp_MSForEachdb @command1='PRINT''[?]''', @command2='USE [?] EXEC sp_helpfile'
This should loop through all databases and give file locations for each database file and log file for each database.
June 14, 2006 at 1:03 pm
I think you meant to use sp_MSForEachDB instead of sp_MSForEachTable
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply