Tag wikis with http links

0

Please login or register to vote for this query.

(click on this box to dismiss)

Gardening and Landscaping

Q&A for gardeners and landscapers

DECLARE @tag_link_table TABLE (TagName nvarchar(35), Link nvarchar(max));

DECLARE @tag_name nvarchar(35);
DECLARE @tag_wiki_id int;
DECLARE @tag_wiki nvarchar(max);

DECLARE tag_cursor CURSOR FOR
SELECT TagName, WikiPostId FROM Tags
ORDER BY TagName ASC

OPEN tag_cursor;

FETCH NEXT FROM tag_cursor INTO @tag_name, @tag_wiki_id;
WHILE @@FETCH_STATUS = 0
BEGIN
    --SET @tag_wiki = (SELECT TOP(1) Body FROM Posts WHERE Id = @tag_wiki_id);

    INSERT INTO @tag_link_table VALUES(@tag_name, @tag_wiki);
   
    FETCH NEXT FROM tag_cursor INTO @tag_name, @tag_wiki_id;
END

CLOSE tag_cursor;
DEALLOCATE tag_cursor;

SELECT * FROM @tag_link_table;

Enter Parameters

Options:
Switch to meta site
loading Hold tight while we fetch your results