我想从ASP.Net应用程序中访问系统表。目前,应用程序使用用户帐户StudentPortal
连接到数据库WebAppClient
。
当我尝试运行以WebAppClient
登录的以下查询时,我收到错误:
用户无权执行此操作。
如何授予访问权限以便我的用户帐户可以查询该系统表?
这是我的完整查询:
SELECT TOP 1
100 - r.SystemIdle AS CPU
FROM (
SELECT
rx.record.value('(./Record/@id)[1]', 'int') AS record_id,
rx.record.value('(./Record/SchedulerMonitorEvent/SystemHealth/SystemIdle)[1]', 'int') AS SystemIdle
FROM (
SELECT CONVERT(XML, record) AS record
FROM sys.dm_os_ring_buffers
WHERE
ring_buffer_type = N'RING_BUFFER_SCHEDULER_MONITOR' AND
record LIKE '%<SystemHealth>%') AS rx
) AS r
ORDER BY r.record_id DESC
答案 0 :(得分:2)