Home Microsoft SQL Server DigiMailing iRN Contact
    Keyword



sys.sp_MSscript_trigger_version_updates

  No additional text.


Syntax
create procedure sys.sp_MSscript_trigger_version_updates
(
    @objid        int,
    @version_col  sysname,
    @indent       int = 0,
    @primary_key_bitmap   varbinary(4000)
)
as
begin
    set nocount on
    declare @cmd nvarchar(4000)
                ,@col sysname
                ,@qualname nvarchar(517)

    
    -- Script out pk var assigment that used in sp_MSscript_where_clause
    
    exec sys.sp_MSscript_pkvar_assignment @objid, NULL, 1, null, null, @primary_key_bitmap
    
    -- Assign the param corresponding to version col to new guid
    
    exec sys.sp_MSget_col_position @objid, null, @version_col, @col output
    exec sys.sp_MSget_qualified_name @objid, @qualname OUTPUT
    select @cmd = N'
        if not update (msrepl_tran_version)
        begin
            select @' + @col + N' = @version_guid
            update ' + @qualname + N' set ' + @version_col + N' = @' + @col + N' '
    insert into #proctext(procedure_text) values(@cmd)
    exec sys.sp_MSscript_where_clause @objid, null, 'trg pk', null, 0, 'upd', @primary_key_bitmap
    select @cmd = N'
        end'
    insert into #proctext(procedure_text) values(@cmd)
    
    -- all done
    
    return 0
end

 
Last revision 2008RTM
See also

  sp_MSscript_trigger_exec_rpc (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