如何在SQL Server 2008中找到数据库的全文索引?

时间:2022-11-14 09:02:38

Hi I am looking for a query that is able to find Full text indexing on all tables and columns within a database using SQL Server 2008. Any information or help that can be provided for this is welcomed

您好我正在寻找能够使用SQL Server 2008查找数据库中所有表和列的全文索引的查询。欢迎提供任何信息或帮助

2 个解决方案

#1


27  

Here's how you get them

这是你如何得到它们

SELECT 
    t.name AS TableName, 
    c.name AS FTCatalogName ,
    i.name AS UniqueIdxName,
    cl.name AS ColumnName
FROM 
    sys.tables t 
INNER JOIN 
    sys.fulltext_indexes fi 
ON 
    t.[object_id] = fi.[object_id] 
INNER JOIN 
    sys.fulltext_index_columns ic
ON 
    ic.[object_id] = t.[object_id]
INNER JOIN
    sys.columns cl
ON 
        ic.column_id = cl.column_id
    AND ic.[object_id] = cl.[object_id]
INNER JOIN 
    sys.fulltext_catalogs c 
ON 
    fi.fulltext_catalog_id = c.fulltext_catalog_id
INNER JOIN 
    sys.indexes i
ON 
        fi.unique_index_id = i.index_id
    AND fi.[object_id] = i.[object_id];

#2


5  

select distinct
    object_name(fic.[object_id])as table_name,
    [name]
from
    sys.fulltext_index_columns fic
    inner join sys.columns c
        on c.[object_id] = fic.[object_id]
        and c.[column_id] = fic.[column_id]

#1


27  

Here's how you get them

这是你如何得到它们

SELECT 
    t.name AS TableName, 
    c.name AS FTCatalogName ,
    i.name AS UniqueIdxName,
    cl.name AS ColumnName
FROM 
    sys.tables t 
INNER JOIN 
    sys.fulltext_indexes fi 
ON 
    t.[object_id] = fi.[object_id] 
INNER JOIN 
    sys.fulltext_index_columns ic
ON 
    ic.[object_id] = t.[object_id]
INNER JOIN
    sys.columns cl
ON 
        ic.column_id = cl.column_id
    AND ic.[object_id] = cl.[object_id]
INNER JOIN 
    sys.fulltext_catalogs c 
ON 
    fi.fulltext_catalog_id = c.fulltext_catalog_id
INNER JOIN 
    sys.indexes i
ON 
        fi.unique_index_id = i.index_id
    AND fi.[object_id] = i.[object_id];

#2


5  

select distinct
    object_name(fic.[object_id])as table_name,
    [name]
from
    sys.fulltext_index_columns fic
    inner join sys.columns c
        on c.[object_id] = fic.[object_id]
        and c.[column_id] = fic.[column_id]