This is not working for me.
Can you check if you have any content or media with null names?
For content (EDITED):
SELECT
n.id,
n.uniqueId,
n.path,
n.text AS nodeName,
cv.text AS versionName,
cv.[current],
ct.alias AS contentTypeAlias
FROM umbracoNode n
INNER JOIN umbracoContent c ON c.nodeId = n.id
INNER JOIN umbracoContentVersion cv ON cv.nodeId = n.id
LEFT JOIN cmsContentType ct ON ct.nodeId = c.contentTypeId
WHERE (n.text IS NULL OR cv.text IS NULL)
AND n.nodeObjectType = 'C66BA18E-EAF3-4CFF-8A22-41B16D66A972'
ORDER BY n.id;
For media (EDITED):
SELECT
n.id,
n.uniqueId,
n.path,
n.text AS nodeName,
cv.text AS versionName,
cv.[current]
FROM umbracoNode n
INNER JOIN umbracoContent c ON c.nodeId = n.id
INNER JOIN umbracoContentVersion cv ON cv.nodeId = n.id
WHERE (n.text IS NULL OR cv.text IS NULL)
AND n.nodeObjectType = 'B796F64C-1F99-4FFB-B886-4BF4BC011A9C'
ORDER BY n.id;
If you do, the names will need to be set or the content removed.
Regards,
Justin