Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Import/Export (DTS) and Replication (2000)
 Scheduled job and sysadmin

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2002-03-04 : 22:21:29
Christine writes "When I run a scheduled job on SQL server V7 sp 2 which executes a system stored procedure (sp_cycle_errorlog) the jobs fails with msg 15003 even though I am running the job as 'sa'"

chadmat
The Chadinator

1974 Posts

Posted - 2002-03-04 : 22:39:51
When scheduled it will run in the security context of the account that SQLAgent is running under. Does that account have permissions?

-Chad

Go to Top of Page

Christine Glew
Starting Member

7 Posts

Posted - 2002-03-08 : 11:14:57
I have discovered that this is a bug (Q241636 on technet) as follows:
(SYMPTOMS
There following system stored procedures check to verify that you are logged in as the system administrator (SA) rather than a member of the System Administrators (sysadmin) role as Books Online (BOL) states:

sp_resetstatus
sp_certify_removable
sp_add_file_recover_suspect_db
sp_cycle_errorlog
sp_create_removable

If you are a member of the sysadmin role and you attempt to run one of these stored procedures, you will receive the following error message:
Server: Msg 15003, Level 16, State 1, Line 0
Only members of the sysadmin role can execute this stored procedure.



CAUSE
These procedures are incorrectly checking to see if SUID <> 1. If SUID is <1>, then the execution of the stored procedure is aborted.



WORKAROUND
To work around this problem, log in as SA rather than as a member of the sysadmin role.
The exception to this rule is sp_cycle_errorlog . This stored procedure is basically executing DBCC ERRORLOG and members of the sysadmin role are able to execute that command directly. This is an undocumented DBCC command but the syntax is very simple. Members of the sysadmin role should run:

dbcc errorlog
and it will return the following message indicating that the errorlog has been cycled:
DBCC execution completed. If DBCC printed error messages, contact your system administrator.


The workaround works
Christine


Go to Top of Page
   

- Advertisement -