Query to Determine Current SQL Instance Name

Here’s a simple query to determine the current SQL server instance name:

select @@SERVERNAME

If this query is executed within a named instance, it will return a result such as

SQLSERVERNAMEDINSTANCE

Leave a Reply

Your email address will not be published. Required fields are marked *