Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I query the Sharepoint database?

I want to retrieve some data. How can I make a query on a Sharepoint database?

like image 514
Red Swan Avatar asked Nov 03 '09 07:11

Red Swan


1 Answers

You shouldn't because of these reasons:

  1. This is completely unsupported by the EULA 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)
  2. Your queries are not guaranteed to work after applying any patches or service packs to SharePoint since Microsoft could change the database schema anytime.
  3. Directly querying the database can place extra load on a server and hence performance issues.
  4. 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.
  5. Your custom queries might lead to incorrect data being retrieved.

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.

However, 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.

But you can make your own database and store some additional information there.

Access SharePoint data the right way

  1. Use SharePoint Object Model (Code can only be run on SharePoint server)
  2. Use SharePoint WebServices (Run code from anywhere, from any application)
  3. SharePoint 2013 now features REST API.
like image 142
Janis Veinbergs Avatar answered Sep 30 '22 05:09

Janis Veinbergs