How to output datafiles location using sp_helpdb?

, 2010-07-02 (first published: )

You can run the result as a csv file or just press F5 for the result set.

set nocount on
declare @dblist varchar(20)
declare cur cursor for select name from sys.databases
open cur
fetch next from cur into @dblist
while @@fetch_status = 0
begin
 exec sp_helpdb @dblist
fetch next from cur into @dblist
end
close cur
deallocate cur

Rate

2.5 (4)

Share

Share

Rate

2.5 (4)

Related content