Category: Uncategorised

Blogging: Controlling SPAM in Orchard CMS with OpenCaptcha
By Art on February 16, 2012

Edit (03-Apr-2017) Orchard has moved on a lot since this was written and as such it is somewhat out of date. I have removed the links to the example code, but left the blog here for prosperity When I started blogging last year, my first major decision was either to host my own site somewhere using a CMS type system […]

Read More
Introduction to XML DML (Part 3) – Using the modify() method: delete
By Art on February 7, 2012

This is the last part of a 3 part blog which will attempt to show some different ways of how you can use the xml modify() method to update the contents of an XML document. This part, starting at the absolute basics, will cover the ability to delete data in an existing XML document XML DML is an extension of […]

Read More
Introduction to XML DML (Part 2) – Using the modify() method: replace value of
By Art on January 26, 2012

This is the second part of a 3 part blog which will attempt to show some different ways of how you can use the xml modify() method to update the contents of an XML document. This part, starting at the absolute basics, will cover the ability to update data in an existing XML document XML DML is an extension of […]

Read More
Introduction to XML DML (Part 1) – Using the modify() method: insert
By Art on January 16, 2012

This is the first part of a 3 part blog which will attempt to show some different ways of how you can use the xml modify() method to update the contents of an XML document. This first part, starting at the absolute basics, will cover the ability to insert data into an existing XML document XML DML is an extension […]

Read More
Retrieving position() value of node by using XQuery alone
By Art on December 28, 2011

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() of the node as a value within the xml itself. My […]

Read More
FOR XML PATH using node tests in column aliases
By Art on December 15, 2011

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 they allow for speedy creation, they also make the query […]

Read More
Convert comma separated string to table and vice versa
By Art on October 27, 2011

I know that this subject has been blogged about numerous times but I thought I’d post an alternative way of shredding a comma separated string to a table that I come up with today, albeit with help from the very clever Itzik Ban-Gan cross join nested CTE that many of us use to generate large tally tables quickly. For sure, […]

Read More
Finding orphaned database users
By Art on October 19, 2011

Database users can become orphaned for a few reasons. For example, a database restore to another instance or deleting the corresponding SQL login would have the effect of leaving a database user orphaned. Development/testing SQL servers may also experience this due to the number of ad-hoc updates that may occur over the years. If you are unlucky enough your production […]

Read More
Simple XML exist performance enhancement
By Art on October 13, 2011

I came across this really simple best practice from BOL for the xml method exist which when used will give you a much cleaner and faster query plan. If like me you commonly use the name of an element or attribute as part of an XQuery predicate, then you would benefit immediately from this. So lets create a table with […]

Read More
Denali
By Art on October 13, 2011

Is all set to be officially known as SQL 2012 and will be finally released in……. 2012! Announced at the PASS Summit 2011, it is due to be released to manufactoring in the first half of next year. The other major announcement from PASS was Microsoft actively supporting the Hadoop project.

Read More