Home Microsoft SQL Server DigiMailing iRN Contact
    Keyword



sys.sp_describe_cursor_columns

  No additional text.


Syntax
-- Creation of sp_describe_cursor_columns

create procedure sys.sp_describe_cursor_columns
(  @cursor_return CURSOR VARYING OUTPUT,
   @cursor_source nvarchar (30),
   @cursor_identity nvarchar (128)
)
AS
declare @scope int
select @cursor_source = LOWER (@cursor_source collate Latin1_General_CI_AS)

/* Check if the cursor exists by name or handle. */
If cursor_status ( @cursor_source, @cursor_identity ) >= -1
begin
	if convert(varchar(30), @cursor_source) = 'local' OR
		convert(varchar(128), @cursor_source) = 'variable'
		select @scope = 1
	else
	if convert(varchar(30), @cursor_source) = 'global'
		select @scope = 2

	set @cursor_return =  	CURSOR LOCAL SCROLL DYNAMIC FOR
				SELECT column_name, ordinal_position, column_characteristics_flags,
					column_size,
					convert(smallint, case when data_type_sql > 32767 then 0 else data_type_sql end) as "data_type_sql",
					column_precision,
					column_scale, order_position, order_direction,
					hidden_column, columnid, objectid, dbid, dbname
				FROM sys.syscursorrefs scr, sys.syscursorcolumns scc
				WHERE 	scr.cursor_scope = @scope and
					scr.reference_name = @cursor_identity and
					scr.cursor_handl = scc.cursor_handle
				ORDER BY 2
				FOR READ ONLY
	open @cursor_return

end

 
Last revision 2008RTM
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