create procedure sys.sp_MSenummergepublications
(
@publication sysname = NULL,
@category int = NULL
)
as
BEGIN
set nocount on
declare @publisher sysname
,@publisher_db sysname
select @publisher=publishingservername()
select @publisher_db=db_name()
-- This SP depends on the pre-creation
-- of the temp table #MSenumpublications
insert into #MSenumpublications
select @publisher_db,
name,
2,
1,
allow_pull,
allow_anonymous,
enabled_for_internet,
0,
snapshot_ready,
0,
1,
is_member('db_owner'),
0, --thirdparty
N'Microsoft SQL Server',
publisher,
N'MSSQLSERVER',
description,
convert(sysname, null),
convert(bit,0), --allow_queued_tran
convert(bit,0), --allow_dts
convert(int, null), -- thirdparty_options
convert(int, null), -- queue_type
dynamic_filters
from dbo.sysmergepublications
where status <> 0
and LOWER(publisher)=LOWER(@publisher)
and publisher_db=@publisher_db
and (@publication is null or name = @publication)
END