How to: Get the name of the running SQL-server instance
Here’s a script to retrieve the name of the currently running SQL Server instance:
SELECT @@SERVERNAME AS 'ServerName'
Resultset:
ServerName
---------------------------
DEV-SQL
(1 row(s) affected)
---------------------------
DEV-SQL
(1 row(s) affected)
I am a .NET programmer first and foremost. But in my spare time I like to play around with PHP, Erlang, Haskell, F#,