슈개's IT/Engineer Room

DB 불필요한 계정 색출 추출하기

슈개 2021. 1. 20. 14:09
반응형

 

SELECT DISTINCT QUOTENAME(LOGINAME, '[]') AS '[LOGIN_NAME]', -> 해당 계정 
QUOTENAME(LOGIN_TIME, '[]') AS '[LOGIN_TIME]', -> 로그인 시간
QUOTENAME(LAST_BATCH, '[]') AS '[LAST_WORK]' -> 최종 작업 시간
FROM sys.sysprocesses ;

 

SELECT DISTINCT QUOTENAME(LOGINAME, '[]') AS '[LOGIN_NAME]',
	QUOTENAME(LOGIN_TIME, '[]') AS '[LOGIN_TIME]',
	QUOTENAME(LAST_BATCH, '[]') AS '[LAST_WORK]'
FROM sys.sysprocesses ;

 

반응형