Ad Widget

Collapse

MSSQL by ODBC: Issue with Job discovery

Collapse
This topic has been answered.
X
X
 
  • Time
  • Show
Clear All
new posts
  • BigSmooth
    Member
    • Jun 2023
    • 46

    #1

    MSSQL by ODBC: Issue with Job discovery

    Hello all,

    I finally managed to make AD authentication work with MS SQL.
    Now, I have another issue:
    Cannot execute ODBC query: [SQL_ERROR]:[42000][229][[Microsoft][ODBC Driver 17 for SQL Server][SQL Server]The SELECT permission was denied on the object 'sysjobs', database 'msdb']

    But if I am trying via isql (with exact same query as in DR definitions), I have access to it:
    isql -v DSN1 [email protected] '****************'
    +---------------------------------------+
    | Connected! |
    | |
    | sql-statement |
    | help [tablename] |
    | quit |
    | |
    +---------------------------------------+
    SQL> select count(*) FROM msdb..sysjobs WHERE enabled = 1
    +------------+
    | |
    +------------+
    | 6 |
    +------------+
    SQLRowCount returns 0
    1 rows fetched


    Any idea how differently zabbix is doing the query?

    Regards,
    Olivier
  • Answer selected by BigSmooth at 30-01-2024, 13:43.
    dedy
    Senior Member
    • Sep 2018
    • 203

    You must give your user this grant

    use msdb
    GRANT SELECT ON OBJECT::msdb.dbo.sysjobs TO user;​

    Comment

    • dedy
      Senior Member
      • Sep 2018
      • 203

      #2
      You must give your user this grant

      use msdb
      GRANT SELECT ON OBJECT::msdb.dbo.sysjobs TO user;​

      Comment

      Working...