Last active
May 9, 2021 19:39
-
-
Save timgaunt/298e5a0b15deb23b81c5513c42b6c19e to your computer and use it in GitHub Desktop.
Find Umbraco Media Files by Size
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT n.id, n.text, n.createDate, c.contentTypeId, FORMAT(CAST(pd.varcharValue AS DECIMAL(18,2)) / 1024 / 1024, '0.00') AS [FileSizeMB], CONCAT('https://wc.uat.sitedr.co.uk/umbraco#/media/media/edit/', n.id) | |
FROM umbracoNode n left JOIN umbracoContent c ON n.id = c.nodeId LEFT JOIN umbracoContentVersion cv ON c.nodeId = cv.nodeId LEFT JOIN umbracoPropertyData pd ON cv.id = pd.versionId AND pd.propertyTypeId=9 | |
where c.contentTypeId=1032 AND cv.[current]=1 | |
ORDER BY CAST(pd.varcharValue AS BIGINT) DESC |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment