Technical Article

How to output datafiles location using sp_helpdb?

,

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

(4)

You rated this post out of 5. Change rating

Share

Share

Rate

(4)

You rated this post out of 5. Change rating