-1

I'm trying to export database from Azure and facing various issues.

One or more unsupported elements were found in the schema used as part of a data package. Error SQL71501: Error validating element [jobs_internal].[visible_targets_formatted]: View: [jobs_internal].[visible_targets_formatted] contains an unresolved reference to an object. Either the object does not exist or the reference is ambiguous because it could refer to any of the following objects: [jobs_internal].[database_credentials].[C], [jobs_internal].[database_credentials].[name] or [jobs_internal].[targets].

I have deleted all the objects from database, but can not delete schema jobs_internal due to dependancy I can not find.

When I execute

drop schema jobs_internal

I get an error about dependancy enter image description here

When I try to find an object, I receive an empty results enter image description here

Same when I try to find by schema SELECT * FROM sys.objects WHERE schema_id = SCHEMA_ID('jobs_internal')

enter image description here

How to find it and drop it, so I can proceed with export?

2 Answers2

0

I also faced similar error while dropping schema.

enter image description here

the reason is schema which we are deleting is also supporting some objects in our database.

To resolve this, you need to find out all objects referenced by the schema "jobs_internal":

SELECT * FROM sys.objects WHERE schema_id = SCHEMA_ID('jobs_internal') 

The objects mentioned in the output must then be moved to the other model or deleted if they are no longer needed. Lastly, the model "user" can be deleted.

Pratik Lad
  • 4,343
  • 2
  • 3
  • 11
  • Thanks, tried that too, but no records. – Sergei Prokopov Feb 27 '23 at 09:14
  • Were you able to find the solution?? I am having the exact issue and unable to locate the objects. – Doodle Jun 01 '23 at 12:16
  • I'm having the exact same problem "Cannot drop schema 'jobs_internal' because it is being referenced by object 'id_list'. I can't find this object anywhere and I'm unable to drop the schema. – Anzel Jul 30 '23 at 16:32
0
DROP TYPE [jobs_internal].[id_list]
Jeremy Caney
  • 7,102
  • 69
  • 48
  • 77
  • 2
    Welcome to Stack Overflow! While this code may solve the question, [including an explanation](//meta.stackexchange.com/q/114762) of how and why this solves the problem would really help to improve the quality of your post, and probably result in more up-votes. Remember that you are answering the question for readers in the future, not just the person asking now. Please [edit] your answer to add explanations and give an indication of what limitations and assumptions apply. – Yunnosch Aug 25 '23 at 20:05