|
|
|
Old Hand
      
Group: General Forum Members
Last Login: Thursday, May 16, 2013 2:30 PM
Points: 352,
Visits: 1,692
|
|
| Hi, I am looking for a script to find out all clustered indexes which are not in primary file group. Please help.
|
|
|
|
|
SSCertifiable
       
Group: General Forum Members
Last Login: Today @ 10:29 AM
Points: 5,201,
Visits: 11,154
|
|
Something along the lines of this should get you started
Select * from sys.indexes Where index_id = 1 And data_space_id > 1
-----------------------------------------------------------------------------------------------------------
"Ya can't make an omelette without breaking just a few eggs"
|
|
|
|
|
SSCertifiable
       
Group: General Forum Members
Last Login: Today @ 10:29 AM
Points: 5,201,
Visits: 11,154
|
|
This is an improvement
select OBJECT_NAME(i.object_id) AS TableName , i.name AS IndexName , FILEGROUP_NAME(i.data_space_id) AS FileGrpName from sys.indexes i inner join sys.objects o on i.object_id = o.object_id where i.index_id = 1 and o.is_ms_shipped <> 1 and i.data_space_id > 1
-----------------------------------------------------------------------------------------------------------
"Ya can't make an omelette without breaking just a few eggs"
|
|
|
|