Stored procedure runs fine when executed manually but fails in scheduled job
0
votes
3
answers
4124
views
I have a stored procedure that runs fine when executed manually but fails in scheduled job. The error I receive is:
>Executed as user: \USER-a. Login failed for user '\USER-a'. [SQLSTATE 28000] (Error 18456). The step failed.
My other stored procedures runs fine when scheduled. The only stored procedures that fails are the ones that are written in this form.
SET @QUERY = 'SELECT * from abc'
EXEC(@QUERY)
Asked by user216531
(1 rep)
Oct 1, 2020, 11:38 PM
Last activity: Oct 3, 2020, 03:47 AM
Last activity: Oct 3, 2020, 03:47 AM