List the path for all MDF and LDF files of all databases

I need to list the patch for all MDF and LDF files of all databases on a SQL
Server 2000 instance.
How to do it?

Thanks,

Felipe
Carlos_FelipeAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Faiga DiegelSr Database EngineerCommented:
select *
FROM master.sys.sysaltfiles
0
BrandonGalderisiCommented:
That will only list the items in master.

This will list all.
select db_name() as 'dbname',* into #Sysfiles from sysfiles
exec sp_msforeachdb 'insert into #sysfiles select ''?'',* from [?]..sysfiles'
select * from #sysfiles
drop table #sysfiles

Open in new window

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
BrandonGalderisiCommented:
and sysfiles is not owned by sys in 2000.  That is a 2005 query where sysfiles is in the sys schema.
0
10 Tips to Protect Your Business from Ransomware

Did you know that ransomware is the most widespread, destructive malware in the world today? It accounts for 39% of all security breaches, with ransomware gangsters projected to make $11.5B in profits from online extortion by 2019.

BrandonGalderisiCommented:
Really?  That's the answer you accept.  It's the wrong answer and it's misleading for future PAQ value.
0
BrandonGalderisiCommented:
Ok.  I missed that you were referring to sysaltfiles, not sysfiles.  But it's still not in SQL 2000.
0
BrandonGalderisiCommented:
I think that a split is more fair, but http:#22996376 still is not SQL 2000 compatible.
0
Faiga DiegelSr Database EngineerCommented:
do you have SQL 200o edition? Try it under master database, it will work.

SELECT * FROM sysaltfiles
0
BrandonGalderisiCommented:
You posted:

select *
FROM master.sys.sysaltfiles
0
BrandonGalderisiCommented:
I think that http:#22996432 and http:#23014321 are two correct answers and should be accepted.  The question should SURELY not be deleted.
0
almanderCommented:
I agree

I think that http:#22996432 and http:#23014321 are two correct answers and should be accepted.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft SQL Server

From novice to tech pro — start learning today.