views:

46

answers:

1

I'm writing an app that retrieves RSS feeds on a scheduled daily basis and saves the contents of each feed as XML Data in a SQL Server 2005 database. I want to display the aggregated items, sorted by date, for example, from the saved feed data in my app in Asp.Net GridViews.

My question is: should I use LINQ to XML to query the feed data, given that I already use LINQ to SQL in the app, or should I aggregate the data using a SQL query in a stored procedure, given that SQL Server 2005 has powerful XML-handling support?

I'm relatively new to both SQL Server 2005 and LINQ, so I can't really see what the relative advantages of either solution are, or whether they aren't really the same thing, effectively.

A: 

Well, I guess it really depends on where you prefer to write code. Personally I'm a lot more comfortable in C# than in T-SQL, so I'd do it in LINQ to XML (and indeed I've done exactly that for an RSS feed before now). It's likely to be pretty simple either way, but I don't see there's really much benefit in doing it in the database unless you're likely to have multiple clients which all want the same XML. Debugging etc tends (IMO) to be easier in C#, and unit tests are easier to write too.

Jon Skeet