May 16, 2012

sp_MShelpfulltextscript (Transact-SQL MetaData) Definition

Please note: that the following source code is provided and copyrighted by Microsoft and is for educational purpose only.
The meta data is from an SQL 2012 Server.

I have posted alot more, find the whole list here.

Goto Definition or MetaData

Definition:

sys.sp_MShelpfulltextscript(nvarchar @tablename)

MetaData:

   
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

No comments:

Post a Comment

Total Pageviews