Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion docs/t-sql/functions/servicename-transact-sql.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ monikerRange: "= azuresqldb-mi-current || >= sql-server-2016 || >= sql-server-li
[!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] runs as a service named MSSQLServer.

## Examples
The following example shows using `@@SERVICENAME`.
The following example shows using `@@SERVICENAME` for a default instance.

```sql
SELECT @@SERVICENAME AS 'Service Name';
Expand All @@ -51,7 +51,21 @@ Service Name
------------------------------
MSSQLSERVER
```

The following example shows using `@@SERVICENAME` for an named instance, named Localhost\SQL2022.

```sql
SELECT @@SERVICENAME AS 'Service Name';
```

[!INCLUDE[ssResult](../../includes/ssresult-md.md)]

```
Service Name
------------------------------
SQL2022
```

## See Also

[Manage the Database Engine Services](../../database-engine/configure-windows/manage-the-database-engine-services.md)
Expand Down