SQL Server/T-SQL Tutorial/System Tables Views/sysfiles
Select * from sysfiles
4> CREATE PROC sp_list_files_and_objects
5> AS
6> SELECT filename FROM sysfiles
7> SELECT name from sysobjects
8> RETURN
9> GO
1>
2> drop PROC sp_list_files_and_objects;
3> GO
1>