Get your favorite SSC scripts directly in SSMS with the free SQL Scripts addin.
Search for scripts directly from SSMS, and instantly access any saved scripts in your
SSC briefcase from the favorites tab.
Download now (direct download link)
Thank this author by sharing:
By RBarry Young,
In response to a request for a script to show all of the objects on a server onwed by a Login. I didn't know of any tool built-in to do this, so I wrote the following proc (SQL Server 2005 only).
Note the following featues also:
If the Dynamic SQL concerns you, then notice that the Login name filter is only applied at the end. This means that you could also take the PRINT output and turn it into a static View. If you leave off the Login name WHERE clause, then this view returns every SQL object in your server with it's proper owner. This static View cna be preserved and reused as-is so long as your database configuration does not change.
You could write a SQL Server 2000 version of this also, but it would be significantly different, because of the large changes in the Schema/Owner security model, though probably simpler.
Change Object Owner
Database Owner and db_owner
globally change all the database owners on a server.
I want:Schema owner should be dbo instead of windows login id at the time to creating any object.