Share via

Problem with target_group

Alice 1 Reputation point
2020-09-30T14:30:18.67+00:00

hello I have implemented a job. The problem is that unfortunately no target group is recognized.

I will skip the steps with credential, master key and group member.
then I write script like this :

exec @jobs .sp_add_job ....

then
exec jobs.sp_add_jobstep @Job _name = 'job1',
@commandcommand = N'exec stored procedure',
@credential_name = '..'
@target _group_name = 'DBG1'; everything works

when I select * from target_group_name it shows me all members from the DBG1, everything works.

Now the problem after this Query : select * from jobs.job_executions where job_name =
'job1'; the columns with target_group, database_name, target_id.... are NULL.

the job is not running, it is just being created. The lifecycle and status are only created and not successful..

can somebody please help me?
thank you

Azure SQL Database
Developer technologies | Transact-SQL
Developer technologies | Transact-SQL

A Microsoft extension to the ANSI SQL language that includes procedural programming, local variables, and various support functions.

SQL Server | Other
SQL Server | Other

Additional SQL Server features and topics not covered by specific categories


1 answer

Sort by: Most helpful
  1. EchoLiu-MSFT 14,626 Reputation points
    2020-10-01T05:57:10.453+00:00

    Hi @Alice

    What is your problem? Is there a problem when creating a job or is there a problem with writing the statement in the job?

    If there is a problem creating a job, please refer to:Create a Job
    If there is a problem with the statement, please share us your table structure (CREATE TABLE …) and some sample data(INSERT INTO …)along with your expected result? So that we’ll get a right direction and make some test.

    Regards
    Echo


    If the answer is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    Was this answer helpful?

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.