0

I'm creating a cron job on SQL Server. As per my knowledge, the only way possible to create a job is through SQL Server Agent. However, the services(listed on services.msc) of VM assigned to me do not contain SQL Server Agent. Also, I don't have sysadmin access to the database. So, can anyone please help me understand how I can create a cron job without SQL Server Agent?

3
  • Possible dup of this question.
    – Dan Guzman
    Commented Oct 8, 2021 at 13:14
  • It's slightly different, in my case, I'm not able to access SQL Server Agent and also I don't have Admin access to the database
    – Yash
    Commented Oct 8, 2021 at 13:17
  • You said you do not have SQL Server Agent. In that case, the answer is the same - just use Task Scheduler. Of course, you will need an account with whatever database permissions you need.
    – Dan Guzman
    Commented Oct 8, 2021 at 13:22

1 Answer 1

0

There is something fishy here. You say that that there's no Agent service. That shouldn't be possible. Agent is always installed (even on Express Edition, but disabled). So we have two options:

  1. There really is no agent. If that is the case you have a botched installation. I would migrate off of this machine onto a healthy machine ASAP.

  2. There is an agent. Then it is only a matter of having a sysadmin allowing you to create jobs. I.e., you don't have to be a sysadmin to create jobs. All you need is to have a user in msdb and that user being a member of any of the SQLAgent roles. More info here:

https://learn.microsoft.com/en-us/sql/ssms/agent/sql-server-agent-fixed-database-roles?view=sql-server-ver15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.