Unable to Export SQL Database

Sergei Prokopov 11 Reputation points
2023-02-23T17:20:55.19+00:00

I'm trying to export the database and receive the following error:

One or more unsupported elements were found in the schema used as part of a data package. Error SQL71501: Error validating element [jobs_internal]: Schema: [jobs_internal] has an unresolved reference to object [##MS_JobAccount##].

I've tried to delete all that is related to [jobs_internal] schema, but there is one object that exists 'id_list' that I can not delete and locate. Selecting from objects returns no results. Drop schema returns an error.

Screenshot 2023-02-23 190448

Screenshot 2023-02-23 190752

SELECT *
  FROM [sys].[objects] 
  where name = 'id_list'

drop schema jobs_internal
Azure SQL Database
0 comments No comments
{count} votes

3 answers

Sort by: Most helpful
  1. RahulRandive 10,486 Reputation points Volunteer Moderator
    2023-02-23T17:33:42.7133333+00:00

    Thanks for your question.

    Here is a possible solution for the issue you are facing.

    The way to ensure that the backup file is consistent is to export a database that has no write activity during the export or create a copy of the database and do the export from that copy.

    1.     Create a database copy.
    You can check how to create a copy of the database using the portal at https://docs.microsoft.com/en-us/azure/sql-database/sql-database-copy-portal 

    2.     Remove the Job related objects from the copy. Please make sure you are connected to the copy.

    3.     Export the database from the copy.

    4.     Delete the database copy.

    Let us know if this works.

    1 person found this answer helpful.
    0 comments No comments

  2. Alberto Morillo 34,671 Reputation points MVP Volunteer Moderator
    2023-02-23T18:50:15.0866667+00:00

    Drop all objects in [jobs] and [jobs_internal] schemas in the following order: stored procedures, functions, views, foreign keys, tables, custom types, schemas, and users.

    After that you will be able to export the database.

    1 person found this answer helpful.
    0 comments No comments

  3. Sergei Prokopov 11 Reputation points
    2023-02-23T19:29:10.5933333+00:00

    That is what helped me to restore db without deleting jobs_internal schema:

      ALTER AUTHORIZATION ON Schema::[jobs_internal] TO [dbo]
    
    1 person found this answer 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.