Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>You shouldn't because of these <a href="http://www.codeproject.com/KB/sharepoint/5-reasons-not-query-sp-db.aspx?msg=3219883" rel="nofollow noreferrer">reasons</a>:</p> <ol> <li>This is completely <a href="http://support.microsoft.com/kb/841057/en-us" rel="nofollow noreferrer">unsupported by the EULA</a> you agreed to when you installed SharePoint. (I have to add a note that changing or calling triggers (except some) directly is unsupported, but not selecting)</li> <li>Your queries are not guaranteed to work after applying any patches or service packs to SharePoint since Microsoft could change the database schema anytime.</li> <li>Directly querying the database can place extra load on a server and hence performance issues.</li> <li>Direct SELECT statements against the database take shared read locks at the default transaction level so your custom queries might cause deadlocks and hence stability issues.</li> <li>Your custom queries might lead to incorrect data being retrieved.</li> </ol> <p>Let me clarify, that #1 DOES NOT ALLOW you to modify sharepoint database in any way. SELECT`ing is permitted, however, as mentioned, that may lead to other problems.</p> <p><strong>However</strong>, if you are not interested in these points, then just use Visual Studio to connect to existing database, just do the regular procedure on how you connect to any other database. </p> <p>But you can make your own database and store some additional information there.</p> <h2>Access SharePoint data the right way</h2> <ol> <li>Use SharePoint <a href="http://extreme-sharepoint.com/2012/07/17/data-access-via-caml-queries/" rel="nofollow noreferrer">Object Model</a> (Code can only be run on SharePoint server)</li> <li>Use SharePoint <a href="http://sarangasl.blogspot.com/2009/12/sharepoint-list-web-service.html" rel="nofollow noreferrer">WebServices</a> (Run code from anywhere, from any application)</li> <li>SharePoint 2013 now features <a href="http://msdn.microsoft.com/en-us/library/jj860569.aspx" rel="nofollow noreferrer">REST API</a>.</li> </ol>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload