Would like query for SQL Server to locate attachments. Was provided the below. Will either of these work for SQL Server?
MYSQL
selectc.TITLE as "Attachment Name", cp.LONGVAL as "File Size",c2.TITLE as "Page Title", s.SPACENAME as "Space Name", concat("http://<confluence_base_url>/pages/viewpageattachments.action?pageId=", c.PAGEID) as "Location"from CONTENT cjoin CONTENT c2 on c.PAGEID = c2.CONTENTIDjoin CONTENTPROPERTIES cp on c.CONTENTID = cp.CONTENTIDjoin SPACES s on c2.SPACEID = s.SPACEID where c.CONTENTTYPE = 'ATTACHMENT' and cp.PROPERTYNAME = 'FILESIZE'order by cp.LONGVAL desc;
POSTGRESQL
select c.TITLE as Attachment_Name, cp.LONGVAL as Attachment_Size, s.spacename,c2.TITLE as Page_Title,'http://<confluence_base_url>/pages/viewpageattachments.action?pageId='||c.PAGEID as Locationfrom CONTENT cjoin CONTENT c2 ON c.PAGEID = c2.CONTENTIDjoin CONTENTPROPERTIES cp on c.CONTENTID = cp.CONTENTIDjoin SPACES s on c2.SPACEID = s.SPACEIDwhere c.CONTENTTYPE = 'ATTACHMENT' and cp.PROPERTYNAME = 'FILESIZE'order by cp.LONGVAL desc;
Replace <confluence_base_url> with your Confluence Base URL . This was tested against MySQL and PostgreSQL.