• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 343
  • Last Modified:

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
0
Carlos_Felipe
Asked:
Carlos_Felipe
  • 7
  • 2
2 Solutions
 
Faiga DiegelCommented:
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
 
BrandonGalderisiCommented:
and sysfiles is not owned by sys in 2000.  That is a 2005 query where sysfiles is in the sys schema.
0
Configuration Guide and Best Practices

Read the guide to learn how to orchestrate Data ONTAP, create application-consistent backups and enable fast recovery from NetApp storage snapshots. Version 9.5 also contains performance and scalability enhancements to meet the needs of the largest enterprise environments.

 
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 DiegelCommented:
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

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 7
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now