Home Microsoft SQL Server DigiMailing iRN Contact
    Keyword



sys.sp_helpmergelogsettings

  No additional text.


Syntax
create procedure sys.sp_helpmergelogsettings(
    @publication            sysname = '%',        /* Publication name */
    @subscriber                sysname = '%',        /* Subscriber server */
    @subscriber_db            sysname = '%',        /* Subscription database */
    @publisher                sysname = '%',        /* Publisher server */
    @publisher_db            sysname = '%'        /* Publisher database */
    )AS

    SET NOCOUNT ON

    /*
    ** Declarations.
    */

    declare @retcode            int
    declare @pubid                uniqueidentifier
    declare @subid                uniqueidentifier

    IF object_id('sysmergesubscriptions') is NULL
        RETURN (0)

    /* Security check */
    EXEC @retcode = sys.sp_MSreplcheck_pull @publication = @publication,
        @raise_fatal_error = 0
    if @@ERROR <> 0 or @retcode <> 0
        return(1)

    /*
    ** Parameter Check: @publisher
    ** Check to make sure that the publisher is defined
    */
    IF @publisher <> '%'
    BEGIN
        EXECUTE @retcode = sys.sp_validname @publisher
        IF @@ERROR <> 0 OR @retcode <> 0
            RETURN (1)
    END

    /*
    ** Parameter Check:     @subscriber.
    ** If remote server, limit the view to the remote server's subscriptions.
    ** Make sure that the name isn't NULL.
    */
    if @subscriber IS NULL
        BEGIN
            RAISERROR (14043, 16, -1, '@subscriber', 'sp_helpmergelogsettings')
            RETURN (1)
        END

    /*
    ** Parameter Check:     @subscriber.
    ** Check if remote server is defined as a subscription server, and
    ** that the name conforms to the rules for identifiers.
    */

    if @subscriber <> '%'
        BEGIN
            EXECUTE @retcode = sys.sp_validname @subscriber

            if @retcode <> 0 OR @@ERROR <> 0
                RETURN (1)

        END

    /*
    ** Parameter Check:     @publication.
    ** If the publication name is specified, check to make sure that it
    ** conforms to the rules for identifiers and that the publication
    ** actually exists.     Disallow NULL.
    */
    if @publication IS NULL
        BEGIN
            RAISERROR (14043, 16, -1, '@publication', 'sp_helpmergelogsettings')
            RETURN (1)
        END

    create table #helplogsettings
                (
                	pubname				 sysname NULL,
                	publisher			 sysname NULL,
                	publisher_db		 sysname NULL,
                	subscriber_server    sysname NULL,
                	db_name              sysname NULL,
		            web_server    		 sysname             NULL,
		            support_options      int NOT NULL default(0),	-- check the SUPPORT_OPTIONS enum in agent code.
                    log_severity		 int NOT NULL default(2),
                    log_modules			 int NOT NULL default(0),
                    log_file_path		 nvarchar(255) NULL,
                    log_file_name		 sysname NULL,
                    log_file_size		 int NOT NULL default(10000000),
                    no_of_log_files		 int NOT NULL default(5),
                    upload_interval 	 int NOT NULL default(0),
                    delete_after_upload	 int NOT NULL default(0),
                    custom_script		 nvarchar(2000) NULL,
                    message_pattern      nvarchar(2000) NULL,
		            last_log_upload_time datetime       NULL
                )


    insert into #helplogsettings select distinct pubs.name, pubs.publisher, pubs.publisher_db, subs.subscriber_server, subs.db_name,
					mss.web_server, mss.support_options, mss.log_severity, mss.log_modules, mss.log_file_path, mss.log_file_name, mss.log_file_size,
					mss.no_of_log_files, mss.upload_interval, mss.delete_after_upload, mss.custom_script, mss.message_pattern, mss.last_log_upload_time

        FROM  dbo.MSmerge_supportability_settings mss,
        	  dbo.sysmergesubscriptions        subs,
              dbo.sysmergepublications    pubs
            where pubs.pubid = subs.pubid
                and subs.pubid <> subs.subid
                and pubs.name =     @publication
                and mss.subid = subs.subid
                and mss.pubid = subs.pubid
                and ((@subscriber_db = N'%') or (subs.db_name = @subscriber_db collate database_default))
                and ((@publisher_db = N'%') or (pubs.publisher_db = @publisher_db collate database_default))
                and ((@subscriber = N'%') or (UPPER(subs.subscriber_server) = UPPER(@subscriber) collate database_default))
                and ((@publisher = N'%') or (UPPER(pubs.publisher) = UPPER(@publisher) collate database_default))

	select * from #helplogsettings
	
    drop table #helplogsettings
    return @retcode

 
Last revision 2008RTM
See also

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