Home Microsoft SQL Server DigiMailing iRN Contact
    Keyword



sys.sp_scriptpubwinsrefreshcursorvars

  No additional text.


Syntax
create procedure sys.sp_scriptpubwinsrefreshcursorvars
(
	@objid int				-- object id
)
as
begin
	declare
			@rc           int
			,@cmd nvarchar(4000)
			,@colname      sysname
			,@ccoltype     sysname
			,@this_col     int
			,@typestring nvarchar(100)
 			,@spacer nvarchar(5)
			,@isset int

	select @cmd = N'
		declare '
		,@spacer = N''

	declare #hccolid cursor local fast_forward for
		select column_id from sys.columns where object_id = @objid order by column_id asc
	open #hccolid
	fetch #hccolid into @this_col
	while (@@fetch_status != -1)
	begin
		exec @isset = sp_MSiscolpk @objid, @this_col
		if @isset != 0 and exists ( select name from sys.columns where object_id=@objid and column_id=@this_col and is_computed !=1 )
		begin
			select @typestring = sys.fn_gettypestring (@objid, @this_col, 1, 0, 0, 0, 1, 0, 0, 0, 0) -- LUDT+Spatial merge conflict trigger
			select @cmd = @cmd + @spacer + N'@pkc' + convert( nvarchar, @this_col ) + N' ' + @typestring
					,@spacer = N','

			if len( @cmd ) > 3000
			begin
				insert into #proctext(procedure_text) values( @cmd )
				select @cmd = N''
			end
		end
		fetch #hccolid into @this_col
	end
	close #hccolid
	deallocate #hccolid
	if len(@cmd) > 0
		insert into #proctext(procedure_text) values( @cmd )
	
	-- all done
	
	return 0
end

 
Last revision 2008RTM
See also

  sp_MSdrop_repltran (Procedure)
sp_MSscript_delete_pubwins (Procedure)
sp_MSscript_insert_pubwins (Procedure)
sp_MSscript_update_pubwins (Procedure)
       



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