To get a list of all the filegroups, use:
select groupname from sysfilegroups
These notes have been tested against SQL Server 7.