| title | sp_grant_publication_access (Transact-SQL) | ||
|---|---|---|---|
| description | sp_grant_publication_access adds a login to the access list of the publication. | ||
| author | VanMSFT | ||
| ms.author | vanto | ||
| ms.reviewer | randolphwest | ||
| ms.date | 06/23/2025 | ||
| ms.service | sql | ||
| ms.subservice | replication | ||
| ms.topic | reference | ||
| f1_keywords |
|
||
| helpviewer_keywords |
|
||
| dev_langs |
|
[!INCLUDE SQL Server]
Adds a login to the access list of the publication. This stored procedure is executed at the Publisher on the publication database.
:::image type="icon" source="../../includes/media/topic-link-icon.svg" border="false"::: Transact-SQL syntax conventions
sp_grant_publication_access
[ @publication = ] N'publication'
, [ @login = ] N'login'
[ , [ @reserved = ] N'reserved' ]
[ , [ @publisher = ] N'publisher' ]
[ ; ]
The name of the publication to access. @publication is sysname, with no default.
The login ID. @login is sysname, with no default.
[!INCLUDE ssInternalOnly]
The name of the publisher. @publisher is sysname, with a default of NULL.
0 (success) or 1 (failure).
sp_grant_publication_access is used in snapshot, transactional, and merge replication.
This stored procedure can be called repeatedly.
Only members of the sysadmin fixed server role or the db_owner fixed database role can execute sp_grant_publication_access.