Identifying a Database's Files, Filegroups

How can I identify all the files and filegroups in a particular database?

Running sp_helpdb will give you the information you need. By supplying the database name in this procedure, you get a result set that shows the file allocation for the specified database, including logical file name, file ID, OS file name (physical file name), the filegroup the file belongs to, file size, the maximum size to which the file can grow, and the growth increment of the file.

—Richard Waymire
Business Intelligence Services,
SQL Server Development Team