sp call from job failed

  • Hello,

    I have a stored procedure named [sp_test]. When I call this in query analyzer (exec sp_test) the sp does his work fine but when i do the same in a job then it fails.

    Maybe i have to give more info but because the sp works fine i don't know what info.

    Hope someone can help me

  • could it be permissions?

    Perhaps you created the proc in your user, and its not accessible to the user agent for scheduled jobs?

    Or maybe you just need to decorate the proc name appropriately

    EXEC user.sp_test

    We have a standard of creating and calling all stored procedures and functions specifically to the dbo schema

    so

    CREATE PROC dbo.sp_test

    and

    EXEC dbo.sp_test

  • Hello

    What is the error message in job history?

    Greets

    Flo

  • Hello Florian

    in the event viewer (application) i see the next message:

    SQL Server Scheduled Job 'TSQL_Job_Test' (0x89B259EBC7C6E5448F3FC92D32AB4FBC) - Status: Failed - Invoked on: 2009-03-13 09:47:50 - Message: The job failed. The Job was invoked by User ***_SERVER\Administrator. The last step to run was step 1 (Step 1).

    is there another logfile "job history"?

    Hein

  • Hello,

    thanks to all for reply.

    the problem where the permissions.

    it is now ok

    hein

  • Hello Hein

    Is this the complete Message?

    Right click on the job, select "View History". You should get a window with a tree on the left side and a list on the right. Above the list there is a text area with detailed error information just like this (an example):

    Date3/13/2009 12:42:50 PM

    LogJob History (test_error)

    Step ID0

    ServerHECTOR

    Job Nametest_error

    Step Name(Job outcome)

    Duration00:00:00

    Sql Severity0

    Sql Message ID0

    Operator Emailed

    Operator Net sent

    Operator Paged

    Retries Attempted0

    Message

    The job failed. Unable to determine if the owner (DOMAINNAME\myaccount) of job test_error has server

    access (reason: Could not obtain information about Windows NT group/user 'DOMAINNAME\myaccount',

    error code 0x5. [SQLSTATE 42000] (Error 15404)).

    Greets

    Flo

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

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