Home Microsoft SQL Server DigiMailing iRN Contact
    Keyword



sys.sp_MSscript_beginproc

  No additional text.


Syntax
create procedure sys.sp_MSscript_beginproc
(
    @publication  sysname,
    @article      sysname,
    @procname     sysname,
    @source_objid int        output,
    @artid int output,
    @alter bit	-- if 1 script alter, otherwise script create
)
as
BEGIN
    declare @cmd nvarchar(4000)
                ,@source_table sysname
                ,@owner sysname

    -- Retrieve underlying table name and replicated columns
    select @source_table = object_name(objid)
            ,@source_objid = objid
            ,@owner = schema_name(objectproperty(objid, 'SchemaId'))
            ,@artid = a.artid
    from sysarticles a, syspublications p
    where a.name = @article and
              p.name = @publication and
              a.pubid = p.pubid
    if @source_table IS NULL
    begin
        raiserror (20506, 16, 1,  @source_table, 'sp_MSscript_beginproc')
        return 1
    end
    
    -- Construct proc name
    -- Create proc under the table owner account to preserve the ownership chain
    
    select @cmd = case @alter when 0 then N'create' else N'alter' end + N' procedure '+QUOTENAME(@owner)+ N'.'+ QUOTENAME(@procname) + N' (
    		@orig_server sysname, @orig_db sysname,'
    exec sys.sp_MSflush_command @cmd output, 1
    
    -- all done
    
    return 0
END

 
Last revision 2008RTM
See also

  sp_MSdrop_repltran (Procedure)
sp_MSscript_sync_del_proc (Procedure)
sp_MSscript_sync_ins_proc (Procedure)
sp_MSscript_sync_upd_proc (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