Conditional create full text catalog in one SQL line (from installer)
I am building an installer using WiX (not a keyword, since WiX is not an issue here) that needs to create a full text index for the SQL Server Express 2005 Advanced Services database.
So far I am using SQL
CREATE FULLTEXT CATALOG Foobar in path 'c:\Whereever'
Now the installer will not delete the database when uninstalling, as it may contain valuable user data. Now when I update my software, it stumbles upon creating a pre-existing full text index. (Abort in installer as it cannot run this SQL line)
What I want to do is run the line conditionally if the full text index doesn't exist yet. I would expect something like
IF NOT EXISTS(SELECT * from sys.??????? WHERE name = 'Foobar')
CREATE FULLTEXT CATALOG Foobar in path 'c:\Whereever'
(I just saw something similar to what I need on this StackOverflow question )
But where (and how) can I find out if the index is written on the sys table (and which table?)
+2
source to share