September 5, 2009 at 3:51 am
I have a table PracticeAccountants. I want to know on which filegroup this table resides. This DB has two filegroups 1. Priamry which is not default. 2. TestOnly which is default.
I know to find this by using 'create script' in SSMS. Is there any T-sql command to do that?
-lk
September 5, 2009 at 3:57 am
use this code.
SELECT o.[name], o.[type], i.[name], i.[index_id], f.[name]
FROM sys.indexes i
INNER JOIN sys.filegroups f
ON i.data_space_id = f.data_space_id
INNER JOIN sys.all_objects o
ON i.[object_id] = o.[object_id]
WHERE i.data_space_id = 2
refer: http://www.mssqltips.com/tip.asp?tip=1112
September 5, 2009 at 4:14 am
Awesome Pradeep. Thanks
September 5, 2009 at 4:18 am
Glad I could help 🙂
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply