SQL Flow Field Guide

PUBLISHINGSERVERNAME

Catalog support for SQL Server 2022 (16.x) and 2025 (17.x)

replication metadata lookup

What changes

Input
replication metadata
Output or change
server name
Return type
nvarchar

Syntax at a glance

PUBLISHINGSERVERNAME()

Work example

Inspect a publishing server name while diagnosing an existing replication setup.

Compare the result with the configured publisher and subscriber roles before changing topology.

Check your work The function returns replication context and is not a general server identity check.

Open Microsoft Learn for full syntax, permissions, and details for your version.