whot to find out .NDF file contents? | SQL Server Performance Forums

SQL Server Performance Forum – Threads Archive

whot to find out .NDF file contents?

hi Guys, how to check the contents of an index file in a database? Let me elaberate the question: I have 1 MDF, 1 LDF and 1 NDF. Now I want to check what are all tables and indexes are assigned into the NDF.
Is there any way to find it out? Thanks
-Johnson
Probably these will get you going:
SELECT
sysFile.groupid AS GroupID
, SUBSTRING(sysFile.groupname,1,30) AS FilegroupName
, SUBSTRING(sysObj.name,1,30) AS ObjectName
FROM sysobjects sysObj
INNER JOIN sysindexes sysIdx
ON sysObj.id = sysIdx.id
INNER JOIN sysfilegroups sysFile
ON sysIdx.groupid = sysFile.groupid
WHERE sysIdx.indid IN(0,1) AND sysObj.xtype = ‘U’
ORDER BY sysFile.groupname, sysObj.ObjectName SELECT
CAST(OBJECT_NAME(sysind.id) AS CHAR(20)) AS TableName
, CAST(sysind.name AS CHAR(30)) AS IdxName
, CAST(sysfg.groupname AS CHAR(10)) AS GroupName
FROM sysindexes sysind
INNER JOIN sysfilegroups sysfg
ON sysind.groupid = sysfg.groupid
INNER JOIN sysobjects sysobj
ON sysind.id = sysobj.id
WHERE sysobj.xtype <> ‘S’
AND sysind.name NOT LIKE ‘_WA%’
ORDER BY sysind.TableName

Frank Kalis
Microsoft SQL Server MVP
http://www.insidesql.de
Ich unterstütze PASS Deutschland e.V. http://www.sqlpass.de)

Thanks Frank ,<br /><br />It worked well.. thanks once again <img src=’/community/emoticons/emotion-1.gif’ alt=’:)‘ /><br /><br />-Johnson
]]>