Sample Header Ad - 728x90

Job getting account disabled Error, but works as normal when executed manually

0 votes
0 answers
413 views
The account used in a linked external SQL Server was disabled, by the external server, temporaly. After the restoration of access, various job routines that used this account continued working, as normal, except one. I'm getting the following error message when the job routine is executed:
Executed as user: \svc_aservice. 
Login failed for user ''. Reason: The account is disabled. [SQLSTATE 42000] (Error 18470).
However, when executed manually, it works perfectly:
The job succeeded.  The Job was invoked by User .  
The last step to run was step 1 ().
Solutions I've tryied so far are: - Creating a new job, inserting the same step:
[].[];
- Changing the name of the old job And also, searching up the error message, but it's all related to the logon still being disabled - which is not the case - since it works when executed manually and other jobs continue to run without any errors. Edit: 1. The SP, executed by the job, is the following:
DECLARE @STATUS INT
    SET @STATUS = ( 
        SELECT COUNT(1) 
        FROM [].[database].[dbo].[table] 
        WITH (nolock)
        WHERE 
        )
    IF ( @STATUS > 1 )
    BEGIN
        TRUNCATE TABLE [dbo].[table]

        INSERT INTO relatorios.dbo.media_du_gerals (
            
            )  
        SELECT 
        FROM
        [LinkedServerName].[database].[dbo].[table] 
        WITH (NOLOCK)
        WHERE 
    END
2. The linked server configuration don't have mapped users. Connection is made via **hostname.** I will be checking if connection source via hostname, over IP adress, can be the cause of the problem. If it is the case, I will post an update.
Asked by gabril (1 rep)
Jun 28, 2022, 01:06 PM
Last activity: Jun 30, 2022, 05:30 PM