Question

Is it possible to get list items using stored procedure in sql server? Everybody can give me any advices to solve that way... I'm very please if you can give me a stored procedure code can do that,

And...is it more effective than another way, such as Rest Service...?

Était-ce utile?

La solution

Technically speaking it is possible, but practically it makes hardly any sense and is highly discouraged. Reasons why not to try fetching SPListItems directly from the SQL database:

  • Legal — the SQL-level data structures and related stored procedures represent Microsoft's intellectual property and even though being officially documented as part of Microsoft Open Specifications, using them requires licensing thereof and paying royalties.
  • Architectural — it's against SharePoint's architecture and overcoming SharePoint's own data access APIs may result in unexpected behavior.
  • Maintenance — there's no guarantee the SQL structures remain the same / compatible across versions whatsoever.
  • Portability — just say good bye to SharePoint Online (Office 365) compatibility.
  • Security — you are effectively bypassing SharePoint's permission checks and security architecture.
  • Governance — no sane SharePoint admin will ever let you access SharePoint's SQL storage directly from a custom (non-Microsoft) code.

The result: don't do it, unless you are in a very specific scenario (e.g. developing complex a migration tool, but I doubt you would be asking such a beginner's question on SO in that case). Speculating about performance is hence irrelevant.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top