Home Microsoft SQL Server DigiMailing iRN Contact
    Keyword



sys.sp_help_fulltext_columns_cursor

  No additional text.


Syntax
create procedure sys.sp_help_fulltext_columns_cursor
	@cursor_return CURSOR VARYING OUTPUT,
	@table_name nvarchar(517) = NULL,		-- table name
	@column_name	sysname = NULL				-- column name
as
	-- FULLTEXT MUST BE ACTIVE IN DATABASE 
	if DatabaseProperty(db_name(), 'IsFulltextEnabled') = 0
	begin
		raiserror(15601,-1,-1)
		return 1
	end

	if @table_name is not null
	begin
		-- VALIDATE TABLE NAME 
		--	(1) Must exist in current database
		declare @objid int
		select @objid = object_id(@table_name, 'local')
		if @objid is null
		begin
			declare @curdbname sysname
			select @curdbname = db_name()
			raiserror(15009,-1,-1 ,@table_name, @curdbname)
			return 1
		end
		--	(2) Must be a user table or indexed view (and not a temp table)
		if (ObjectProperty(@objid, 'IsUserTable') = 0 AND (ObjectProperty(@objid, 'IsView') = 0 OR ObjectProperty(@objid, 'IsIndexed') = 0 )) OR
		    substring(parsename(@table_name,1),1,1) = '#'
		begin
			raiserror(15218,-1,-1 ,@table_name)
			return 1
		end

		-- VALIDATE COLUMN NAME (CANNOT BE COMPUTED) 
		if @column_name is not null
		begin
			declare @typename sysname
			select @typename = type_name(ColumnProperty(@objid, @column_name, 'SystemType'))
			if @typename is null
			begin
				raiserror(15104,-1,-1,@table_name,@column_name)
				return 1
			end
		end
	end

	-- We are using schema owner as table owner now. Check with garish for their decision on using schema owner
	-- in place of table owner for backward compatibility issue.
	set @cursor_return =	CURSOR LOCAL SCROLL STATIC FOR
	select distinct
			ssche.name as TABLE_OWNER,
			sftcol.object_id as TABLE_ID,
			sobj.name as TABLE_NAME,
			scol.name as FULLTEXT_COLUMN_NAME,
			sftcol.column_id as FULLTEXT_COLID,
			scol2.name as FULLTEXT_BLOBTP_COLNAME,
			case sftcol.type_column_id
			     when 0 then null
                 else sftcol.type_column_id
			end as FULLTEXT_BLOBTP_COLID,
			sftcol.language_id as FULLTEXT_LANGUAGE
	from
			sys.fulltext_index_columns as sftcol
			-- the nolock is to not block while crawl or master merge is creating fragments
			join sys.objects as sobj WITH (NOLOCK) on(sftcol.object_id = sobj.object_id)
			join sys.columns as scol on (sftcol.object_id = scol.object_id and sftcol.column_id = scol.column_id)
			left outer join sys.columns as scol2 on (sftcol.object_id = scol2.object_id and sftcol.type_column_id = scol2.column_id)
			join sys.schemas as ssche on (sobj.schema_id = ssche.schema_id)
	where 	(
			  @column_name is null or
			  scol.name = @column_name
			)
			AND (
			  @table_name is null or
			  sobj.object_id = @objid
			)
	order by TABLE_OWNER, TABLE_NAME, FULLTEXT_COLID

	open @cursor_return

	-- SUCCESS 
	return 0	-- sp_help_fulltext_columns_cursor

 
Last revision SQL2008SP2
News

  Query a named instance
Sybase+ASE+silent+install
SQL 2008 R2
Deprecated procedures in SQL2008
Reporting Services item-level role definitions
Create all your missing indexes
Converting datetime field
Start MSSQL Server Profiler at time
Replicating MSSQL Server views
Exploring Microsoft Sharepoint
The OLE DB provider "SQLNCLI10" for linked server indicates.
Mobile solar charger
Oracle to SQL Server replication
Cannot insert the value NULL into column
Undocumented Microsoft SQL Server 2008
VMware
Zoekmachine optimalisatie
SQL Servers hidden objects
FckEditor
Flash in Ajax
De hype die AJAX heet
Barcode scannen
MySQL; Gratis, makkelijk en snel!
PHP
sIFR; de combinatie tussen HTML en Flash