filegroup in SQL
--Viewing the filegroup to which tables belong to
SELECT d.[Name] 'File Group',
OBJECT_NAME(i.[Object_ID]) 'Table Name'
FROM sys.data_spaces d Join sys.indexes i On(d.data_space_id = i.data_space_id)
join sys.tables t on t.object_id =i.object_id
WHERE i.object_id =OBJECT_ID ('EmployeeMaster') ORDER BY 2
--To check for a specific table
SELECT d.[Name] 'File Group',
OBJECT_NAME(i.[Object_ID]) 'Table Name'
FROM sys.data_spaces d Join sys.indexes i On(d.data_space_id = i.data_space_id)
WHERE i.object_id =OBJECT_ID ('EmployeeMaster')
filegroup in SQL
Reviewed by Rupesh
on
22:43
Rating:
No comments: