I need to modify a column definition, but I would like to check if the column is full text enabled first. Is there a way to do such a check in a TSQL script?
I'm using SQL Server 2005.
I need to modify a column definition, but I would like to check if the column is full text enabled first. Is there a way to do such a check in a TSQL script?
I'm using SQL Server 2005.
You could try using the COLUMNPROPERTY() function.
DECLARE @value INT;
SELECT @value = COLUMNPROPERTY(OBJECT_ID('schema.table'), 'column_name', 'IsFulltextIndexed')
IF (@value = 1)
PRINT 'Fulltext column'
ELSE
PRINT 'No Fulltext column'
You can try something like this:
SELECT *
FROM sys.columns c
INNER JOIN sys.fulltext_index_columns fic ON c.object_id = fic.object_id
AND c.column_id = fic.column_id
If you need to limit it to a given table, use this:
SELECT *
FROM sys.columns c
INNER JOIN sys.fulltext_index_columns fic ON c.object_id = fic.object_id
AND c.column_id = fic.column_id
WHERE c.object_id = OBJECT_ID('YourTableNameHere')