Test Long URL

0

Please login or register to vote for this query.

(click on this box to dismiss)

Test query for the bug: http://meta.stackoverflow.com/questions/118594/data-explorer-truncates-links-after-380-characters

Stack Overflow

Q&A for professional and enthusiast programmers

DECLARE @UserId int = ##UserId##

SELECT TOP 15
    TagName,
    COUNT(*) AS UpVotes 
INTO #orig    
FROM Tags
    INNER JOIN PostTags ON PostTags.TagId = Tags.id
    INNER JOIN Posts ON Posts.ParentId = PostTags.PostId
    INNER JOIN Votes ON Votes.PostId = Posts.Id and VoteTypeId = 2
WHERE 
    Posts.OwnerUserId = @UserId
GROUP BY TagName 
ORDER BY UpVotes DESC

DECLARE @TagList varchar(8000)
SELECT @TagList = COALESCE(@TagList + '%7c', '') + TagName
FROM #orig

DECLARE @VotesList varchar(8000)
SELECT @VotesList = COALESCE(@VotesList + ',', '') + CAST(UpVotes AS varchar(100))
FROM #orig

DECLARE @VotesLabels varchar(8000)
SELECT @VotesLabels = COALESCE(@VotesLabels + '%7c', '') + CAST(UpVotes AS varchar(100))
FROM #orig

--SELECT TagName, UpVotes,
--       'http://chart.apis.google.com/chart?cht=p&chco=FF0000,FFFF00%7cFF8000,00FF00%7c00FF00,0000FF&chs=450x200&chd=t:'
--       +@VotesList+'&chl='+@VotesLabels+'&chdl='+@TagList+'|Chart' [Chart Link]
--FROM #orig

SELECT 'http://chart.apis.google.com/chart?cht=p&chco=FF0000,FFFF00%7cFF8000,00FF00%7c00FF00,0000FF&chs=450x200&chd=t:122,42,17,10,8,7,7,7,7,6,6,6,6,5,5&chl=122%7c42%7c17%7c10%7c8%7c7%7c7%7c7%7c7%7c6%7c6%7c6%7c6%7c5%7c5&chdl=android%7cjava%7cstack-trace%7cbroadcastreceiver%7candroid-ndk%7cuser-agent%7candroid-webview%7cwebview%7cbackground%7cmultithreading%7candroid-source%7csms%7cadb12345678%7Csollections%7cactivity'

Enter Parameters

Options:
Switch sites:
loading Hold tight while we fetch your results