No lines in MSDB.dbo.sysmail_faileditems

Initially, I was getting a "no SELECT privileges" error when trying to request content for the report that I need to create. Therefore, we provided DatabaseMailUserRoleMSDB for my account - I see columns, but not one of the data that we know does not exist.

What am I missing, what do I need to do for my account to see the data?

+3
source share
2 answers
select OBJECT_DEFINITION(OBJECT_id('sysmail_faileditems')) 
AS [processing-instruction(x)] FOR XML PATH('')

Shows sysmail_faileditemsdefinition

SELECT * FROM msdb.dbo.sysmail_allitems WHERE sent_status = 'failed'

Looking at sysmail_allitems. This definition

SELECT ...
FROM msdb.dbo.sysmail_mailitems
WHERE (send_request_user = SUSER_SNAME()) 
      OR (ISNULL(IS_SRVROLEMEMBER(N'sysadmin'), 0) = 1)

, , sysadmin, , .

+6

. . database.dbo.mytable database.klowrey.mytable.

. , .

0

Source: https://habr.com/ru/post/1764216/


All Articles