DATETIME SELECT SELECT INTO DATE PAD STRING DYNAMIC SQL CURSOR MONEY FORMAT PERCENT STORED PROCEDURE SQL SERVER AGENT JOB OPTIMIZATION WHILE LOOP OVER PARTITION BY UPDATE
 
 
SITE SEARCH SQLUSA.com VIDEOS
 
 
SQL E/BOOKS   WORLD, USA & SQL NEWS   FORMAT
SCRIPTS SQL 2005 SQL 2008 ARTICLES
How to find out the server name?

Execute the following Microsoft SQL Server T-SQL scripts in SSMS Query Editor to find the name of the server and IP address:

 

-- System variable

SELECT @@SERVERNAME;

-- LONDONPROD3\SQL8

 

-- SERVERPROPERTY - similar: OBJECTPROPERTY

SELECT CONVERT(SYSNAME,SERVERPROPERTY('servername')) AS ServerName,

       SERVERPROPERTY('ProductVersion')              AS ProductVersion,

       SERVERPROPERTY('ProductLevel')                AS ProductLevel,

       SERVERPROPERTY('Edition')                     AS Edition,

       SERVERPROPERTY('EngineEdition')               AS EngineEdition;

 

GO

/*

ServerName  ProductVersion    ProductLevel      Edition     EngineEdition

SQLUSAPROD    10.0.4000.0       SP2   Enterprise Edition (64-bit)   3

*/

 

-- IP Address

exec master..xp_cmdshell 'ipconfig'

/*

....

   IPv4 Address. . . . . . . . . . . : 134.128.100.201

.... */


Related articles:

SERVERPROPERTY (Transact-SQL)

SQL - Query to get server's IP address

Getting the IP Address of a system using Stored Procedure

 

Exam Prep 70-461
SQL 2016 DESIGN & PROGRAMMING
 
 
 
DATETIME SELECT SELECT INTO DATE PAD STRING DYNAMIC SQL CURSOR MONEY FORMAT PERCENT STORED PROCEDURE SQL SERVER AGENT JOB OPTIMIZATION WHILE LOOP OVER PARTITION BY UPDATE