Enable SQL Server Agent on Linux (and in Docker)

Building off a post from my old website:
If you are running SQL Server on Linux (or the SQL Server on Linux Docker image) and connect to it from a Windows system with Management Studio (SSMS), the SQL Agent will be off. If you right click the Agent in SSMS try to get the properties of it, you will receive a lengthy error:

So how do you turn SQL Agent on? Open a query window and execute this script from the 
Master database:

sp_configure 'show advanced options', 1;
GO
RECONFIGURE;
GO
sp_configure 'Agent XPs', 1;
GO
RECONFIGURE
GO

Finally, right click on SQL Agent in SSMS and choose Refresh from the menu. You should now be able to access it.

There is another way to do this from within Azure Data Studio. Install the SQL Agent Extension from the Marketplace. 


Once its installed, from the Master database, execute the script above. Then refresh the connection. Finally right click the connection, and choose Manage from the menu that appears. You get the Administrative panel and at the bottom of the left pane you'll see SQL Agent! Click on it and the first option on right is Jobs 

SQL Server is a product of Microsoft Corporation.

Comments