O'Reilly logo

Microsoft® SQL Server™ 2000 Programming by Example by Carlos Eduardo Rojas, Fernando G. Guerrero

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

System Functions Used in Multi-Instance Installations

Two system functions return information related to instances:

  • SERVERPROPERTY—This function takes one parameter and returns information about the server where the instance is installed. If the parameter is machinename, this function returns the name of the server. If the parameter used is servername, it returns the name of the server, along with the name of the instance. If instancename is used as the parameter, the function returns the name of the current instance, and if it's the default instance, it returns NULL. Listing A.3 shows how to use this function with the parameters described.

Code Listing A.3. Using the SERVERPROPERTY Function
					 USE Master SELECT SERVERPROPERTY('machinename') SELECT ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required