데이터베이스 Microsoft SQL Server 2008 r2가 있습니다. 기본 데이터베이스의 테이블에 액세스 할 수있는 marie라는 사용자가 정의됩니다. 이것은 잘 작동합니다. 이제 marie가이 쿼리를 수행 할 수 있기를 바랍니다.
SELECT resource_type,spid,login_time,status,hostname,program_name,nt_domain,nt_username,loginame
FROM sys.dm_tran_locks dl
JOIN sys.sysprocesses sp on dl.request_session_id = sp.spid
관련된 테이블은 마스터 테이블입니다. 마리에게 그들에게서 읽을 수있는 권한을 어떻게 부여합니까? 이미 dbo로 다음을 실행하려고했습니다.
GRANT ALL on sys.dm_tran_locks TO marie
GRANT ALL on sys.sysprocesses TO marie
여전히 marie가 위의 쿼리를 수행하려고 할 때 오류는 다음과 같습니다.
Msg 297, Level 16, State 1, Line 1
The user does not have permission to perform this action.
내가 도대체 뭘 잘못하고있는 겁니까?
sys.dm_exec_requests,sys.dm_exec_sessions등은,sysprocesses이전 버전과의 호환성보기이며, 어떤 시점에서 제품에서 제거됩니다.