If I populate a temporary table or a table variable, is there a way to search it with CONTAINS?
You can search a table using CONTAINS, if the table has a full-text index. Whether you can create a full-text index on a temporary table or table variable is another question.
I tried this -->
CREATE TABLE #sp_who3 ( SPID INT NOT NULL, Status VARCHAR(32) NULL, Login SYSNAME NULL, HostName SYSNAME NULL, BlkBy SYSNAME NULL, DBName SYSNAME NULL, Command VARCHAR(32) NULL, CPUTime INT NULL, DiskIO INT NULL, LastBatch VARCHAR(14) NULL, ProgramName VARCHAR(32) NULL, SPID2 INT ) CREATE UNIQUE INDEX ui_SPID ON #sp_who3(SPID); CREATE FULLTEXT CATALOG ft AS DEFAULT; CREATE FULLTEXT INDEX ON #sp_who3(Command) KEY INDEX ui_SPID WITH STOPLIST = SYSTEM;
The CREATE FULLTEXT INDEX failed with: Invalid object name '#sp_who3'
No one has followed this question yet.