퇴근5분전


음 아래처럼 하면 가져온다.


출처 : http://translate.google.co.kr/translate?hl=ko&langpair=en%7Cko&u=http://wiki.lessthandot.com/index.php/Get_The_Domain_Name_Of_Your_SQL_Server_Machine_With_T-SQL

DECLARE @DOMAINNAME NVARCHAR(100)
EXEC MASTER.DBO.XP_REGREAD
    'HKEY_LOCAL_MACHINE',
    'SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon',
    N'CachePrimaryDomain',    
    @DOMAINNAME OUT

SELECT @DOMAINNAME