Home Microsoft SQL Server DigiMailing iRN Contact
    Keyword



sys.sp_MSrepl_PAL_rolecheck

  No additional text.


Syntax
CREATE PROCEDURE sys.sp_MSrepl_PAL_rolecheck
@publication sysname = NULL,
@artid uniqueidentifier = NULL,
@repid uniqueidentifier = NULL,
@pubid uniqueidentifier = NULL,
@objid int                = NULL,
@tablenick int = NULL,
@partition_id int = NULL
AS
    -- sysadmin or db_owner have access
    if is_member('db_owner') = 1
        return 0

    if (@pubid is not NULL)
    begin
        if (1 <> {fn ISPALUSER(@pubid)})
        begin
            RAISERROR (14126, 11, -1)
            return (1)
        end
    end
    else if (@publication is not NULL)
    begin
        if not exists (select * from dbo.sysmergepublications where name = @publication and UPPER(publisher)=UPPER(publishingservername()) and publisher_db=db_name() and (1 = {fn ISPALUSER(pubid)}))
        begin
            RAISERROR (14126, 11, -1)
            return (1)
        end
    end
    else if (@artid is not NULL)
    begin
        if not exists (select * from dbo.sysmergearticles where artid = @artid and (1 = {fn ISPALUSER(pubid)}))
        begin
            RAISERROR (14126, 11, -1)
            return (1)
        end
    end
    else if (@repid is not NULL)
    begin
        if not exists (select * from dbo.sysmergesubscriptions where subid = @repid and (1 = {fn ISPALUSER(pubid)}))
        begin
            RAISERROR (14126, 11, -1)
            return (1)
        end
    end
    else if (@tablenick is not NULL AND @tablenick <> 0)
    begin
        if not exists (select * from dbo.sysmergearticles where nickname = @tablenick and (1 = {fn ISPALUSER(pubid)}))
        begin
            RAISERROR (14126, 11, -1)
            return (1)
        end
    end
    else if (@objid is not NULL)
    begin
        if not exists (select * from dbo.sysmergearticles where objid = @objid and (1 = {fn ISPALUSER(pubid)}))
        begin
            RAISERROR (14126, 11, -1)
            return (1)
        end
    end
    else if (@partition_id is not NULL)
    begin
        if not exists (select * from dbo.MSmerge_partition_groups p1, dbo.sysmergepublications p2
                        where p1.partition_id = @partition_id and p1.publication_number = p2.publication_number
                            and (1 = {fn ISPALUSER(p2.pubid)}))
        begin
            RAISERROR (14126, 11, -1)
            return (1)
        end
    end
    else if not exists(select * from dbo.sysmergepublications where (1 = {fn ISPALUSER(pubid)}))
    begin
        RAISERROR (14126, 11, -1)
        return (1)
    end

    return 0

 
Last revision 2008RTM
See also

  sp_check_dynamic_filters (Procedure)
sp_helpmergepublication (Procedure)
sp_is_makegeneration_needed (Procedure)
sp_mergemetadataretentioncleanup (Procedure)
sp_MSacquireHeadofQueueLock (Procedure)
sp_MSacquireSlotLock (Procedure)
sp_MSaddmergedynamicsnapshotjob (Procedure)
sp_MSadd_dynamic_snapshot_location (Procedure)
sp_MSallocate_new_identity_range (Procedure)
sp_MSalreadyhavegeneration (Procedure)
sp_MScheckexistsgeneration (Procedure)
sp_MScheckfailedprevioussync (Procedure)
sp_MScheckIsPubOfSub (Procedure)
sp_MScheck_logicalrecord_metadatamatch (Procedure)
sp_MScheck_subscription_expiry (Procedure)
sp_MScheck_subscription_partition (Procedure)
sp_MScreateglobalreplica (Procedure)
sp_MScreateretry (Procedure)
sp_MScreate_tempgenhistorytable (Procedure)
sp_MSdeleteretry (Procedure)
sp_MSdelrow (Procedure)
sp_MSdelsubrows (Procedure)
sp_MSdelsubrowsbatch (Procedure)
sp_MSdroparticletombstones (Procedure)
sp_MSdropretry (Procedure)
sp_MSdrop_tempgenhistorytable (Procedure)
sp_MSdummyupdate (Procedure)
sp_MSdummyupdate90 (Procedure)
sp_MSdummyupdate_logicalrecord (Procedure)
sp_MSensure_single_instance (Procedure)
sp_MSenumchanges (Procedure)
sp_MSenumchangesdirect (Procedure)
sp_MSenumchanges_belongtopartition (Procedure)
sp_MSenumchanges_notbelongtopartition (Procedure)
sp_MSenumdeletes_forpartition (Procedure)
sp_MSenumpartialchanges (Procedure)
sp_MSenumpartialchangesdirect (Procedure)
sp_MSenumpartialdeletes (Procedure)
sp_MSenumreplicas90 (Procedure)
sp_MSenumretries (Procedure)
sp_MSenum_logicalrecord_changes (Procedure)
sp_MSevaluate_change_membership_for_all_articles_in_pubid (Procedure)
sp_MSevaluate_change_membership_for_pubid (Procedure)
sp_MSevaluate_change_membership_for_row (Procedure)
sp_MSfetchidentityrange (Procedure)
sp_MSfixlineageversions (Procedure)
sp_MSgetalternaterecgens (Procedure)
sp_MSgetchangecount (Procedure)
sp_MSgetconflictinsertproc (Procedure)
sp_MSgetdatametadatabatch (Procedure)
sp_MSgetdynamicsnapshotapplock (Procedure)
sp_MSgetdynsnapvalidationtoken (Procedure)
sp_MSgetlastrecgen (Procedure)
sp_MSgetlastsentgen (Procedure)
sp_MSgetlastsentrecgens (Procedure)
sp_MSgetmakegenerationapplock (Procedure)
sp_MSgetmakegenerationapplock_90 (Procedure)
sp_MSgetmetadatabatch (Procedure)
sp_MSgetmetadata_changedlogicalrecordmembers (Procedure)
sp_MSgetonerow (Procedure)
sp_MSgetpubinfo (Procedure)
sp_MSgetrowmetadata (Procedure)
sp_MSget_dynamic_snapshot_location (Procedure)
sp_MSget_logicalrecord_lineage (Procedure)
sp_MSget_subscriber_partition_id (Procedure)
sp_MShelp_identity_property (Procedure)
sp_MSinitdynamicsubscriber (Procedure)
sp_MSinserterrorlineage (Procedure)
sp_MSlocalizeinterruptedgenerations (Procedure)
sp_MSlocktable (Procedure)
sp_MSmakeconflictinsertproc (Procedure)
sp_MSmakegeneration (Procedure)
sp_MSmakegenerationold (Procedure)
sp_MSmap_partitionid_to_generations (Procedure)
sp_MSmergeupdatelastsyncinfo (Procedure)
sp_MSmerge_getgencur_public (Procedure)
sp_MSneedmergemetadataretentioncleanup (Procedure)
sp_MSproxiedmetadata (Procedure)
sp_MSproxiedmetadatabatch (Procedure)
sp_MSreleasedynamicsnapshotapplock (Procedure)
sp_MSreleasemakegenerationapplock (Procedure)
sp_MSreleaseSlotLock (Procedure)
sp_MSremove_mergereplcommand (Procedure)
sp_MSrequestreenumeration (Procedure)
sp_MSscriptviewproc (Procedure)
sp_MSsetgentozero (Procedure)
sp_MSsetlastrecgen (Procedure)
sp_MSsetlastsentgen (Procedure)
sp_MSsetreplicaschemaversion (Procedure)
sp_MSsetreplicastatus (Procedure)
sp_MSsetrowmetadata (Procedure)
sp_MSset_logicalrecord_metadata (Procedure)
sp_MSupdategenerations_afterbcp (Procedure)
sp_MSupdaterecgen (Procedure)
sp_MSuplineageversion (Procedure)
sp_MSvalidate_dest_recgen (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