Tuesday 15 March 2011

tsql - Check if a full text catalog exists in 2000 -


I am trying to figure out that the database has a specific full text catalog, so that I can use it or I can escape the execution of the part of a script which will create errors without the list. I can use the address in SQL Server 2005 you can use:

  if exists (selection from sys.fulltext_catalogs 1 ou Name = 'catalog_name')   

But we have to support SQL Server 2000 A still and I could not use it. What is another way to check for the list?

Checking @@ version may require shuffle, but this should work:

  declared @catalogexists tinyint set @catalogexx = 0 (if the @@ version ('% SQL% server% 2000%')) starts when it exists (select 1 from [Master]. [Dbo]. [Sysfulltextcatalogs] where name = 'catalog_name') set @catalogExists = 1 end if someone else exists (select from 1 sys.fulltext_catalogs where name = 'catalog_name') set @catalogExists = 1 end print @catalogexxists    

No comments:

Post a Comment