XML Workshop XVIII - Generating an RSS 2.0 Feed with TSQL

  • Comments posted to this topic are about the item XML Workshop XVIII - Generating an RSS 2.0 Feed with TSQL


  • I got a challenge. The RSS 2.0 Google Base feed:


    It seemed like it would be easy using the following:


    'urn:http://base.google.com/ns/1.0' as "g"


    however, the result repeats the namespace for each of the items.

    It appears to be well-formed, but I am unsure if Google will accept the feed with the extra namespace for each item. Do you know of another way to do this without the namespace getting repeated?

  • Good article. A new area to explore.


  • I dont think a feed parser will complain for the namespace declaration on the item elements.

    I had been writing another article on ATOM feed and realized that feed validators do not complain about the extra namespace declarations on the child elements.


  • Thanks Jacob. I will try to upload a feed and see if it they accept it.

  • Fantastic article! This was a good read.

    I may use this technique for my one of my websites. I use SQL2k5 and was going to integrate RSS feeds. This technique just gave me the info I was looking for.


  • I've also enjoyed the article.

    It's very clean to do that in this way. There's no need to do it in .NET 🙂

    I also suppose that it performs much better...

  • I like the article, it's very cool stuff. I'm just starting to look at RSS feeds, and this seems a very simple way to do it, without writing any ASP.net, though it seems if there is a login on your site, you might have too anyway.

    My question is:How do I get my web page to see this view?. I run the SELECT statement at the end of your article, and a single item is generated, how do I turn that into a web page people see? I'm missing the final step about how to make this XML public, I guess.


  • You need to create a page that executes the TSQL code and returns the resultant XML to the HTTP response stream. The caller (usually an rss reader or a browser that understands how to display a feed) will identify the content type and will display the feed accordingly.


  • One option is to write a .NET application that executes the query/stored procedure and writes the output to a file: http://www.sqlservercentral.com/articles/XML/62054/

    Or use a command line utility like sqlcmd.exe etc that can generate a file with the output of a query.


Viewing 10 posts - 1 through 9 (of 9 total)

You must be logged in to reply to this topic. Login to reply