>I need a script which will provide me the same layout that we obtain when we go in Database\Properties\Files. This is where we see the location of the .mdf, all the .ndf, if more than one, and the .ldf. I thought that would be nice to have, as on a particular server, this would save a lot of time for several persons to have to go in SSMS to get that. Is there anyone who already built this script who would like to share it or some of it, or ideas behind that?
Jes Borland Schulz has a great blog on this topic
Replacing sysfiles With sys.database_files
If it's not broken, fix it until it is.
My Blog