日期:2014-05-17 浏览次数:20996 次
SET QUOTED_IDENTIFIER ON
SET ANSI_NULLS ON
GO
create procedure sys.sp_MStran_ddlrepl
(
@EventData xml
,@procmapid int
)
AS
begin
set nocount on
declare @retcode int
-- validate the procmapid
if @procmapid not in (1,2,3,4)
begin
raiserror(15021, 16, -1, '@procmapid')
goto FAILURE
end
--if transactional replication is not enabled for this db, don't do anything
if (sys.fn_MSrepl_istranpublished (db_name(),0) != 1)
return 0
declare @object_name sysname
,@object_owner sysname
,@qual_object_name nvarchar(512) --qualified 2-part-name
,@objid int
,@objecttype varchar(32)
,@encrypted nvarchar(32)
,@pass_through_scripts nvarchar(max)
,@eventDoc int
,@dbname sysname
,@targetobject nvarchar(51)
,@debug_print bit
if object_id('MSrepl_debug_DDL') is not null
set @debug_print = 1
else
set @debug_print = 0
set @targetobject = N''
select @object_name = event_instance.value('ObjectName[1]', 'sysname')
,@object_owner = event_instance.value('SchemaName[1]', 'sysname')
,@objecttype = event_instance.value('ObjectType[1]',&