Running SQL queries directly from SQL server management studio is not safe method until you know what you are doing but it is always Good to use reporting services in Configmgr 2012.
when you are running SQL code using SQL management studio,you get error something like below due to insufficient privileges on the selected Database:
The SELECT permission was denied on the object ‘v_PackageStatusRootSummarizer’, database ‘CM_P01′, schema ‘dbo’.
Permission was denied because you do not have enough read permissions to execute the query against the database.
Get the read permissions on the selected Database from your Configmgr admin team.
How to provide Read Permissions on the Database for the selected Group or User ?
Open SQL mgmt Studio,connect to the server
Expand Databases—>CM_Sitecode—Security—>Users ,select the Group or User name properties to provide Read permissions
Go to the Membership Tab ,select DB_DataReader,Click ok
Close the Management Studio and re-Open it again before you execute the query.
SCCM Configmgr SQL Error:The SELECT permission was denied on the object database ‘CM_Sitecode′, schema ‘dbo’. is a post from: Eswar Koneti's Blog