0

I am scheduling a job in SQL Server, but the SQL Server Agent is not visible in my SQL Server Management Studio and I am using version Microsoft SQL Azure. After creating user and assigning sysadmin roles to it, the problem still lying there.

I have created a user through Login under Security tab in Object Explorer. Assigned the sysadmin roles to that user as following through the link.

USE [master]
GO
CREATE LOGIN [test] WITH PASSWORD=N'Cppa!66***', DEFAULT_DATABASE=[master], CHECK_EXPIRATION=OFF, CHECK_POLICY=OFF
GO
EXEC master..sp_addsrvrolemember @loginame = N'test', @rolename = N'sysadmin'
GO

I expect the result as after creating and assigning roles, the SQL Server Agent option must be visible under Object Explorer, but Nothing changes.

  • 1
    SQL Azure doesn't have SQL Agent. – Nick.Mc Sep 26 '19 at 05:56
  • You should really be using `ALTER SERVER ROLE` as well, `sp_addsrvrolemember` is deprecated and will stop working one day. – Thom A Sep 26 '19 at 06:34
  • 1
    @Nick.McDermaid Are you sure about that? – Kapil Sonii Sep 26 '19 at 07:32
  • "Azure SQL" the PaaS offering does not have SQL Agent. I am sure about that. Are you sure exactly what you are connecting to? Please run `SELECT @@VERSION` so we're all on the same page – Nick.Mc Sep 26 '19 at 07:44
  • @Nick.McDermaid yes, I am using SQL Azure, that's why I asked you. Well thanks. – Kapil Sonii Sep 27 '19 at 04:20
  • There's no product called SQL Azure. Given all the confusion, you might have been referring to SQL Server inside an Azure VM, which _does_ have SQL Agent (unless it's SQL Express). That's why it is important upfront to quote `@@VERSION`, otherwise we're all guessing. **HINT:** please edit the question and post `@@VERSION` – Nick.Mc Sep 27 '19 at 04:43
  • @Nick.McDermaid Sorry I got confused. Yes Actually the version is: `Microsoft SQL Server 2016 (RTM) - 13.0.1601.5 (X64) Apr 29 2016 23:23:58 Copyright (c) Microsoft Corporation Express Edition (64-bit) on Windows 10 Pro 6.3 (Build 17763: )` – Kapil Sonii Sep 27 '19 at 06:49

1 Answers1

0

You are running SQL Express on a VM. I guess the VM happens to be on Azure. Regardless of VM location, SQL Express does not have SQL Agent.

If you want to schedule activities you can remote on to the VM and use windows scheduler.

Nick.Mc
  • 18,304
  • 6
  • 61
  • 91