permissions on xp_sqlmaint

  • When attemting to run a job owned by my account the following error is reported : -

    EXECUTE permission denied on object 'xp_sqlmaint', database 'master', owner 'dbo'. [SQLSTATE 42000] (Error 229)

    The error is reported when the job is run, either through enterprise manager or by executing sp_start_job.  However if xp_sqlmaint is called directly in Query Analyser while logged on with my account, the maintenance task runs without error.

    Books on line records that permission to execute xp_sqlmaint defaults to members of the db_owner fixed database role in database master and members of the sysadmin fixed server role.

    My account is reported by; is_member and IS_SRVROLEMEMBER as a member of both the listed roles as required.

    Simply changing the job owner to the account assigned to SQL Agent allows the job to run. 

    However, I cannot see why my account is unable to run the task as a job?  Any suggestions as to what should be looked at next would be very much appreciated.

    many thanks

    Dan

  • Go to Job proprties>Steps>Edit the step>go to Advanced option see what is specified in Run as user field. Changing this to a login with SA access should help.

    Anurag nayar

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply