CREATE FUNCTION [dbo].[GetCurrentIP] () RETURNS varchar(255) AS BEGIN DECLARE @IP_Address varchar(255); SELECT @IP_Address = client_net_address FROM sys.dm_exec_connections WHERE Session_id = @@SPID; Return @IP_Address; END
1. To findout "SERVER NAME"SELECT SERVERPROPERTY('MACHINENAME')2. To findout "SERVER NAME" with "INSTANCE NAME" (If its Named Instance)SELECT SERVERPROPERTY('SERVERNAME')3. To findout "CLIENT MACHINE NAME"(Local Machine Name)SELECT HOST_NAME()
1. To findout "SERVER NAME"
ReplyDeleteSELECT SERVERPROPERTY('MACHINENAME')
2. To findout "SERVER NAME" with "INSTANCE NAME" (If its Named Instance)
SELECT SERVERPROPERTY('SERVERNAME')
3. To findout "CLIENT MACHINE NAME"(Local Machine Name)
SELECT HOST_NAME()