create proc sys.sp_MShelpfulltextscript
@tablename nvarchar(517)
as
set nocount on
declare @objid int
select @objid = object_id(@tablename)
if (@objid is null)
begin
RAISERROR (15001, -1, -1, @tablename)
return 1
end
/* prepare the information for fulltext index scripting */
declare @activate int
select @activate = OBJECTPROPERTY(@objid, N'TableFulltextCatalogId')
if (@activate <> 0)
begin
declare @uniqueindex nvarchar(128)
declare @catname nvarchar(128)
/* get unique index name */
select @uniqueindex = i.name from dbo.sysindexes i where @objid = i.id and IndexProperty(@objid, i.name, N'IsFulltextKey') = 1
/* get catalog name */
select @catname = f.name from dbo.sysfulltextcatalogs f, dbo.sysobjects o where f.ftcatid = o.ftcatid and o.id = @objid
if (@uniqueindex is not null and @catname is not null)
begin
/* is this table fulltext index activated? */
select @activate = OBJECTPROPERTY(@objid, N'TableHasActiveFulltextIndex')
select @uniqueindex, @catname, @activate
end
end