How can I change the target database for an Azure Elastic Job?

Simon Graham 25 Reputation points
2023-11-12T10:23:57.4966667+00:00

I have an existing Azure Elastic Job which targets an Azure SQL database and executes once daily. I need to change the target database for the existing elastic job.

I have found the following column which contains the name of the current target
[jobs_internal].[targets].[database_name]

Does anyone know if it's ok to simply update this column value or is there more to it?

Azure SQL Database
{count} votes

Accepted answer
  1. ShaktiSingh-MSFT 15,921 Reputation points
    2023-11-14T05:20:33.9466667+00:00

    Hi
    Simon Graham
    ,

    Below is the response from internal team:

    You should not update internal tables/views.  That can corrupt the Jobs DB and make your jobs fail. They are for querying/read only. You can use the stored procedures that are installed on your Jobs DB to add/delete target groups/members.

    https://learn.microsoft.com/en-us/azure/azure-sql/database/elastic-jobs-tsql-create-manage?view=azuresql#job-stored-procedures

    https://learn.microsoft.com/en-us/sql/relational-databases/system-stored-procedures/sp-add-target-group-member-elastic-jobs-transact-sql?view=azuresqldb-current

    Hope this helps.

    Let us know if you have further queries.

    Thanks


0 additional answers

Sort by: Most helpful

Your answer

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