Home > Articles > Databases > SQL Server

Generating Atom Feed from SQL Data

  • PrintPrint
  • Share ThisShare This
  • DiscussDiscuss
Microsoft SQL Server 2005 has extensive support for XML document generation. In this article, Ivan Pepelnjak describes how you can use it to produce an Atom feed directly on the SQL Server with the Transact SQL commands.

Atom technology (not the one discussed by nuclear physicists) was created in 2003 to address the shortcomings of the then-prevalent RDF Site Summary (RSS; also known as Really Simple Syndication) family of incompatible formats. It gained widespread adoption when Google decided to use it as the Application Program Interface (API) to a variety of its services including Blogger, Gmail, Google News, Google Blog Search, and Google Maps. The Atom format is becoming a generic protocol facilitating data exchange between web services and applications. For example, the Google Maps support the display of locations encoded within an Atom feed with the GeoRSS elements.

In this article, you'll see how you can create an Atom feed from data in your SQL database. We'll use a simple product description table containing product identifiers, names, and descriptions:

CREATE TABLE Products (
 PartNo   nvarchar(20) NOT NULL,
 ProductName nvarchar(200) NOT NULL,
 ProductDescription nvarchar(max) NOT NULL,
 CONSTRAINT PK_Products PRIMARY KEY CLUSTERED (PartNo ASC)
)

You could place this feed directly onto your web site to allow your visitors to subscribe to new product information.

  • Share ThisShare This
  • Save To Your Account

Discussions

comments powered by Disqus

Related Resources

There are currently no related podcasts. Please check back later.

Careful with those NULLs
By on October 13, 2010Comments

Many folks (including me) use NULL values in their databases. There's actually a bit of controversy on even having them - but I don't fall on the side of never using the. But you do need to exercise some care...

The true value of conferences
By on October 5, 2010Comments

I recently returned from the "SQLBits" conference in York, England. I met a lot of folks that I've seen before at other conferences, but I also met a fair amount that had not been to a SQL Server conference before.

Finding Big Data
By on September 16, 2010Comments

I get asked from time to time about locating "Big Data" - or large sets of data for an application.

See All Related Blogs