Monthly Archives: March 2012

Comparing users and role memberships between two databases

The other day I was asked to restore a production database into a development environment and then check the database permissions. So after restoring the database I ran use ‘database name’ exec sp_change_users_login ‘report’ to see if there were any … Continue reading

Posted in Database options, Security, T-SQL | Leave a comment

Querying SQL Server maintenance plans

A request came in to enumerate active maintenance plans and associated jobs across a range of servers. Here is the query I developed for the purpose. select p.name as ‘Maintenance Plan’ ,p.[description] as ‘Description’ ,p.[owner] as ‘Plan Owner’ ,sp.subplan_name as … Continue reading

Posted in SQL Server, T-SQL | 3 Comments