I had a Blog page with the Tag cloud web part for Blogs and everything was working OK.
I changed Select top N documents from Empty to 20
And I got the following SQL exception on my web site front end
[DataConnection.ExecuteQuery]:
Query: SELECT TOP 20 DISTINCT CMS_Tag.TagID, TagName, TagCount
FROM CMS_DocumentTag
JOIN CMS_Tag ON CMS_DocumentTag.TagID = CMS_Tag.TagID
JOIN CMS_TagGroup ON CMS_Tag.TagGroupID = CMS_TagGroup.TagGroupID
WHERE (DocumentID IN
(SELECT DocumentID FROM View_CMS_Tree_Joined
WHERE (((SiteName = N'CommunitySite')
AND (Published = 1)) AND (NodeAliasPath LIKE N'/Blog/%'))
AND (TagGroupName = 'Blogs' AND TagGroupSiteID = 2)))
ORDER BY TagName ASC
: caused exception: Incorrect syntax near the keyword 'DISTINCT'.
Incorrect syntax near ')'.
Regarding this I have 2 questions
1) Instead of SELECT TOP 20 DISTINCT one should write SELECT DISTINCT TOP 20 ... Bad mistake.
2) Why SQL exception is visible on the Front-end UI ??? Do you think it is a good practice ? :)
I would expect exception details to be written to the application log or somewhere else, but not on my Front-end.