Where are the Documents or files we uploaded or attached stored in sharepoint? Many of them know, those files are stored under SharePoint Content Database. But on which database table, on which format?
For that, i did a quick research on that, and here i give those results,
- The AllDocStreams table in SharePoint Content Database stores the Document Contents.
- The Contents of the document are stored in Content Column in the AllDocStream table.
- The Content column is the Image Datatype, (stores in the format of Binary).
I provide a simple SQL Query to retrieve the Document List Name,File Name, URL, and the Content (Binary Format)
SELECT AllLists.tp_Title AS ‘List Name’,
AllDocs.LeafName AS ‘File Name’,
AllDocs.DirName AS ‘URL’,
AllDocStreams.Content AS ‘Document Contnt (Binary)’
AllLists.tp_id = AllDocs.ListId
By Sooner, I’ll come up with other interesting Sql Query Tips.
April 27, 2009 at 6:22 AM
Hi, thanks for answering my post in the msdn site.
I’m currently wanting to create a webpart that contain hyperlink to link to latest dated document in the doc lib. But different hyperlink come from different subfolder. Any help to that?
November 21, 2010 at 11:52 PM
I want a way access attachment file in sharepoint list through sql query,
I dot’n understand,where is attachment files store ? all content of attachment file store in the WSS_Content database or just address of attachment file in my hard, store in the WSS_Contetnt database in sql?
Can you give me a sql query for access all content of attachment file?