Microsoft OLE DB Provider for ODBC Drivers error '80004005'

[Microsoft][ODBC SQL Server Driver][SQL Server]SQL Server blocked access to procedure 'sys.xp_sqlagent_enum_jobs' of component 'Agent XPs' because this component is turned off as part of the security configuration for this server. A system administrator can enable the use of 'Agent XPs' by using sp_configure. For more information about enabling 'Agent XPs', search for 'Agent XPs' in SQL Server Books Online.

/scripts/dbwa/dbwa2.asp, line 1661



Solution

This error occurs because the Agent XPs (Agent Extended Procedures) option in SQL Server is disabled. This option controls access to certain system stored procedures related to SQL Server Agent, such as xp_sqlagent_enum_jobs.

To resolve this issue, you need to enable the Agent XPs option by running the following T-SQL command:

sql
Copy code
EXEC sp_configure 'show advanced options', 1; RECONFIGURE; EXEC sp_configure 'Agent XPs', 1; RECONFIGURE;

Steps to Enable Agent XPs:

  1. Open SQL Server Management Studio (SSMS) and connect to your SQL Server instance.
  2. Open a new query window and paste the above T-SQL commands.
  3. Execute the query.