List and changing object owner with SQL Simon Hutchinson

​At my work one of the things that auditors look for is who owns all the objects in the production libraries. If there are objects that do not belong to the expected user profile then they want an explanation of why they do not. The week before the auditors are due I do a “scan” of all the production libraries, I am responsible, for to look for any objects that do not belong to the expected user profile, it’s better to be prepared than be surprised by the auditors.
Fortunately I can perform the “scan” of all those libraries at once with a SQL View, OBJECT_OWNERSHIP, to return a list of objects that do not belong to the expected user profile.
For the purposes of this post I am going to limit my examples to the objects in my personal library, MYLIB. And I am only interested in a few of the columns of this View:
Read more » Read More 

Verified by MonsterInsights