HEELPBOOK - SELECT MACHINE NAME (CLIENT OR SERVER) AND INSTANCE NAMES (SQL SERVER) ################ To get the instance name: SELECT @@ServerName To get the machine name of the server: SELECT SERVERPROPERTY("MachineName") To get the machine name of the computer running the query: SELECT host_name() #### One tip: cast the serverproperty as a varchar if you want to use it in a string or you will get errors in your stored procedures/query/ies. ############ ARTICLE INFO ############# Article Month: December Article Date: 20/12/2012 Permalink: http://heelpbook.altervista.org/2012/select-machine-name-client-or-server-and-instance-names-sql-server/ Source: http://blog.stevienova.com/2007/06/26/sql-server-select-machine-computer-instance-names/ Language: English View more articles on: http://www.heelpbook.net/ Follow us on Facebook: http://it-it.facebook.com/pages/HeelpBook/100790870008832 Follow us on Twitter: https://twitter.com/#!/HeelpBook Follow us on RSS Feed: http://feeds.feedburner.com/Heelpbook Follow us on Delicious: http://delicious.com/heelpbook Linkedin: http://it.linkedin.com/pub/stefano-maggi/27/73a/b20 Google+ : https://plus.google.com/116990277568167008289/posts