I don't have access to msdb.dbo
tables so I am trying to insert records in temp table
Example
For msdb.dbo.sysjobactivity
I did as
Create table #Sysjobactivity (All columns here)
Insert into #sysjobactivity
Execute msdb.dbo.sp_help_jobactivity---worked fine for this
But for msdb.dbo.syssessions
I am unable to insert
Create table #syssessions(all columns here)
Insert into #syssessions
execute msdb.dbo.help_sessions
But I can't see any msdb.dbo.help_sessions , is there a way we can insert
Because of an access issue, I am trying to go through this route.
1条答案
按热度按时间v8wbuo2f1#
The problem seems to be that you are not in the
sysadmin
fixed server role, which is listed in the documentation as a requirement for readingsyssessions
directly.This is not a problem we can solve for you.
There is no easy way to "get around" a
sysadmin required
security restriction unless someone is willing to give yousysadmin
(which I doubt and don't recommend anyway).I'm not sure where you read about
help_sessions
but that is not a stored procedure that ships with SQL Server, so that is why you can't find it.Now, you can have someone with appropriate access create this procedure for you:
But I suspect you won't be able to do that yourself.
That said, since we've now learned that you just want to know when SQL Server Agent last started:
Which doesn't require
sysadmin
, onlyVIEW SERVER STATE
(see the docs).