December 3, 2010 at 9:28 am
Good morning
i have a table namaed tablex, i know that a table has only one filegroup but no in 2 FG. DOESNT IT?
in SSMS tells me that tablex is in FG x and using sp_help tablex tells me the that object is storaged in that FG.
i appreciate yor help
December 3, 2010 at 12:45 pm
If it is a partitioned table it can be in multiple File groups, each partition can be in a different file group. I am unsure what info SSMS would give you for a partitioned table. Also the table can be in one file group and indexes can be in a different file group(s).
below is code you can run that will give you the file group of all tables but it should give you the same info SSMS does.
SELECT OBJECT_NAME(a.[object_id]) AS ObjectName,
a.[name] AS IndexName,
b.[name] AS FileGroupName
FROM sys.indexes a
JOIN sys.data_spaces b
ON a.[data_space_id] = b.[data_space_id]
WHERE a.[index_id] = 0
Viewing 2 posts - 1 through 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply