i have a XML schema bound to a table. however, sometimes testers piggyback and bind to this schema too. when there is this “ninja” XML table reference, any alteration to this schema is painful.
i’d like to run a query before schema altering and raise exception if the XML schema is bound to more than one table. i’ve looked at sys.sql_dependencies and few of the other sys.xml_XXXX tables, but it’s not clear how to do this in tsql. is something like this possible?
Something like this might be helpful
This one is to find where the schema is used in a XML parameter.