Skip to content

Instantly share code, notes, and snippets.

@webgio
Last active August 8, 2019 13:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save webgio/aa32b3622bfda8bd083abfdff097aad3 to your computer and use it in GitHub Desktop.
Save webgio/aa32b3622bfda8bd083abfdff097aad3 to your computer and use it in GitHub Desktop.
How do I list all tables / columns in my SQL server / Azure database that have a full-text index
SELECT name, case FULLTEXTCATALOGPROPERTY(name, 'PopulateStatus')
when 0 then 'Idle'
when 1 then ' Full population in progress'
when 2 then ' Paused'
when 3 then ' Throttled'
when 4 then ' Recovering'
when 5 then ' Shutdown'
when 6 then ' Incremental population in progress'
when 7 then ' Building index'
when 8 then ' Disk is full. Paused.'
when 9 then ' Change tracking' end AS Status
, *
from sys.fulltext_catalogs
SELECT
t.name AS TableName,
c.name AS FTCatalogName ,
i.name AS UniqueIdxName,
cl.name AS ColumnName,
cdt.name AS DataTypeColumnName
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]
LEFT JOIN
sys.columns cdt
ON
ic.type_column_id = cdt.column_id
AND fi.object_id = cdt.object_id;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment