Writing SQL query to read data from CRM 2011


Staff member
I am very aware that updating and creating records using SQL in CRM is a very bad idea, but I am wondering if it is possible to do read only sql queries to the database.

What I want to do is to create a small program that I can point at a CRM2011 server and entity in this database and generate an excel document with all the fields display and database names, as well as pick list options and their id's.

Examples of such queries can be found here:

<li><a href="https://stackoverflow.com/questions...mics-crm-store-optionset-values-in-sql-server">Where does Microsoft Dynamics CRM store OptionSet values in SQL Server?</a></li>
<li><a href="http://petecrm2011.wordpress.com/tag/sql/" rel="nofollow noreferrer">http://petecrm2011.wordpress.com/tag/sql/</a></li>
<li><a href="http://www.mohamedibrahim.net/blog/...ttribute-and-stringmap-picklist-values-table/" rel="nofollow noreferrer">http://www.mohamedibrahim.net/blog/...ttribute-and-stringmap-picklist-values-table/</a></li>

I know how to do this by connecting directly to the SQL server, but I would prefer if I can do this using the address of the CRM server, i.e. not needing to go through SQL security but simply needing an admin account to CRM.

Hoping this isn't a horrible idea as it would make my life as a developer a little easier.