Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 SQL Server Administration (2005)
 Object File and File Group Information

Author  Topic 

lionofdezert
Aged Yak Warrior

885 Posts

Posted - 2009-05-18 : 01:24:14
How to get File and File Group Information for a specific object (table,view or index)

OR

Which objects an ndf file contains ???

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2009-05-18 : 01:38:30
use sp_help


KH
[spoiler]Time is always against us[/spoiler]

Go to Top of Page

sagitariusmzi
Posting Yak Master

113 Posts

Posted - 2009-05-18 : 01:52:44
sp_helpdb 'dbname'
Go to Top of Page

lionofdezert
Aged Yak Warrior

885 Posts

Posted - 2009-05-18 : 01:56:31
select 'table_name'=object_name(i.id)
,i.indid
,'index_name'=i.name
,i.groupid
,'filegroup'=f.name
,'file_name'=d.physical_name
,'dataspace'=s.name
from sys.sysindexes i
,sys.filegroups f
,sys.database_files d
,sys.data_spaces s
where
objectproperty(i.id,'IsUserTable') = 1
and f.data_space_id = i.groupid
and f.data_space_id = d.data_space_id
and f.data_space_id = s.data_space_id
order by f.name,object_name(i.id),groupid

----Thanx for your help guys
Go to Top of Page
   

- Advertisement -