SQL Flow Field Guide

@@REMSERVER

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

reads configuration (@@ function)

What changes

Input
server or session configuration state
Output or change
value
Return type
nvarchar(128)

Syntax at a glance

@@REMSERVER

Work example

Inspect the remote server name in an existing remote execution context.

Read in the same session and compare before and after a controlled session setting change.

Check your work An unexpected value can mean the query is not running through the expected remote path.

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