How to get IP Address of SQL Server and Client IP Address

SELECT SERVERNAME = CONVERT(NVARCHAR(128),SERVERPROPERTY('SERVERNAME')) 

,LOCAL_NET_ADDRESS AS 'IPAddressOfSQLServer'

,CLIENT_NET_ADDRESS AS 'ClientIPAddress'

, NETBIOS = CONVERT(NVARCHAR(128),SERVERPROPERTY('COMPUTERNAMEPHYSICALNETBIOS')) 

, [MAXDOP] = (SELECT VALUE_IN_USE FROM SYS.CONFIGURATIONS WHERE NAME='MAX DEGREE OF PARALLELISM')  

, SQLMEMORY = (SELECT VALUE_IN_USE FROM SYS.CONFIGURATIONS WHERE NAME='MAX SERVER MEMORY (MB)') 

, EDITION = CONVERT(NVARCHAR(128),SERVERPROPERTY('EDITION')) 

, COLLATION = CONVERT(NVARCHAR(128),SERVERPROPERTY('COLLATION')) 

, ISCLUSTERED = CONVERT(BIT,SERVERPROPERTY('ISCLUSTERED')) 

, ISFULLTEXTINSTALLED = CONVERT(BIT,SERVERPROPERTY('ISFULLTEXTINSTALLED')) 

, ISINTEGRATEDSECURITYONLY = CONVERT(BIT,SERVERPROPERTY('ISINTEGRATEDSECURITYONLY')) 

, FILESTREAMCONFIGUREDLEVEL = CONVERT(TINYINT,SERVERPROPERTY('FILESTREAMCONFIGUREDLEVEL')) 

, FILESTREAMEFFECTIVELEVEL = CONVERT(TINYINT,SERVERPROPERTY('FILESTREAMEFFECTIVELEVEL')) 

, PRODUCTVERSION = CONVERT(NVARCHAR(128),SERVERPROPERTY('PRODUCTVERSION')) 

, SQLCHARSETNAME = CONVERT(NVARCHAR(128),SERVERPROPERTY('SQLCHARSETNAME')) 

, SQLSORTORDERNAME = CONVERT(NVARCHAR(128),SERVERPROPERTY('SQLSORTORDERNAME'))

 FROM SYS.DM_EXEC_CONNECTIONS WHERE SESSION_ID = @@SPID

 

Comments

Post a Comment

Hi User,
Thanks for visiting My Blog and please provide your valuable feedback and subscribe for more updates. Please don't post any spam content or comments.
Thank You

Popular Posts

Failed to execute the package or element. Build errors were encountered

Restore of database 'DataBase_Name' failed. (Microsoft.SqlServer.Management.RelationalEngineTasks)