![]() ![]() Here’s what I get on my Mac running SQL Server for Linux via a Docker container. However, the results you get will depend on a couple of things (mentioned below). The SERVERPROPERTY() function can also be used to return the machine name as well as the SQL Server instance name. So for example, on a Windows system, if your computer name is Felix, and your SQL Server instance is called sql1, running SERVERPROPERTY('ServerName') might return Felix\sql1. The ServerName property provides the Windows server and instance name that together make up the unique server instance.provides the currently configured local server name.The two functions are similar, but slightly different. The two functions above produce the same output on my machine, but you might find that they produce slightly different output on yours. ![]() To return the server name, you need to pass ServerName as an argument. The SERVERPROPERTY() metadata function can also be used to return the server name, as well as many other properties. This tells me that my server name is mssql2019_1. To get the server name, you simply select it using a SELECT statement. configuration function is designed specifically for returning the name of the local server that is running SQL Server. ![]() Here are a couple of T-SQL methods you can use to return the server name in SQL Server. ![]()
0 Comments
Leave a Reply. |