Wednesday, March 7, 2012

Permission to execute a job

I have a stored proc that refreshes data and then does a table swap.
As part of the table swap I need to drop and create a table. This requires
basically dbo permissions.
So I create a job to run my proc and the job runs under the sa accout.
But I need an account that is not sa or dbo to have the the ability to run
this job as needed rather than just having it run when scheduled.
Is it possible to grant permissions to a non-sa/dbo account so that it can
call this job?
IOW, I don't want my non-sa/dbo account to have any special dbo-like
permissions except the ability to execute a table swap within the context of
my stored proc.
How can I best accomplish this?Create a table for your sp to add a row to when it wants to run the job.
Have a scheduled job poll that table and when it sees a new row it starts
your job.
"Dave" wrote:

> I have a stored proc that refreshes data and then does a table swap.
> As part of the table swap I need to drop and create a table. This require
s
> basically dbo permissions.
> So I create a job to run my proc and the job runs under the sa accout.
> But I need an account that is not sa or dbo to have the the ability to run
> this job as needed rather than just having it run when scheduled.
> Is it possible to grant permissions to a non-sa/dbo account so that it can
> call this job?
> IOW, I don't want my non-sa/dbo account to have any special dbo-like
> permissions except the ability to execute a table swap within the context
of
> my stored proc.
> How can I best accomplish this?
>
>

No comments:

Post a Comment