Programming XQuery in SQL Server 2005

There are a lot of changes afoot in SQL Server 2005 with regards to programming routines.  (Remember that ANSI defines a routine as a stored procedure, user-defined function, or user-defined method.)  The biggest and most controversial change is that you’ll no longer be forced to use Transact-SQL for programming routines.


In SQL Server 2005, you’ll be able to use any .NET language via the Common Language Runtime (CLR).  You will also be able to use a native XML querying language called XQuery.  The CLR is generating a lot of excitement in the developer community and a lot of consternation in the DBA community.  The jury is still out on how rapid or widespread the adoption of CLR will be, especially in enterprise IT settings because most DBAs don’t know how to code in CLR languages and most developers don’t have good set-based programming skills.


XQuery, on the other hand, is a sort of marriage between XML and SQL.  XQuery can not only retrieve XML data, but it also inserts, updates, and deletes it too, just like SQL.  XQuery allows you to address the semi- or self-defining structures of XML documents.


I do not propose to be an expert on XQuery or even average at it.  But I think this is one more change brought on by SQL Server 2005 that you should be aware of.  It’s high on my radar and it should be on yours too.


I’m currently reading up on XQuery and my first introduction to it was on at  What other resources have you found that have helped you understand XQuery?  I’d love to hear about them, as would our other readers.  Thanks for sharing!


Warm wishes for a happy New Year!



Hide comments


  • Allowed HTML tags: <em> <strong> <blockquote> <br> <p>

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.