If you’re creating a SQL Server Agent job for the first time, you might find that you need to enable the SQL Server Agent extended stored procedures (SQL Server Agent XPs) first.
When you use the SQL Server Management Studio (SSMS) tool to start the SQL Server Agent service, these extended stored procedures are enabled automatically.
When you use T-SQL, you can enable the SQL Server Agent XPs with the sp_configure
stored procedure.