SQL Clone
SQLServerCentral is supported by Redgate
Log in  ::  Register  ::  Not logged in

SQL Server Rocks!

SQL Database Administrator/Developer. Background in developing OLTP/document based databases, SQLXML and performance tuning with an unhealthy fascination for the SQL query optimiser!

Archives: December 2011

Retrieving position() value of node by using XQuery alone

You can only use the position() function within an xquery predicate and can't use it to return the position value of the node itself, which is a shame, but a couple of good workarounds have been published. However I had a requirement (don't ask why!) to return the position()… Read more

0 comments, 5,059 reads

Posted in SQL Server Rocks! on 28 December 2011

FOR XML PATH using node tests in column aliases

I've used SQL to generate countless blobs of xml over the years and one feature that I have come to rely heavily upon is the ability to easily build complex xml structures by using column aliases in conjunction with the FOR XML PATH clause in your query. Not only do… Read more

0 comments, 8,043 reads

Posted in SQL Server Rocks! on 15 December 2011