Author Archives: ph1lqu1nn

Auditing Your Database Changes

SQL Server can capture Database level Trigger information using XML.  I personally use this on my home PC’s because I’m poor and can’t afford one of those amazing DB Source control products that are out there on the market. I’m … Continue reading

Posted in Uncategorized | Leave a comment

Recursive XML branches

One of the main features of XML is that it handles hierarchical data structures.  I agree that so does SQL either using the hierarchy variable or creating a Recursive CTE.  but nothing compares to the simplicity  of the XML format … Continue reading

Posted in Uncategorized, XML | Leave a comment

Enforcing XML Document Structure

by default the xml variable supports a content structure of xml this is very useful if you are constructing an xml blob.  It works for typed and untyped code, and it has it’s place. The following code shows an xml … Continue reading

Posted in XML, XML Schemas | Tagged , | Leave a comment

Schema visibility using xml_schema_namespace

One of the issues I’ve faced is the constant referencing and rereferencing of XML Schemas that are stored against a database.  the xml_schema_namespace dmv helps with this.  it takes 2 parameters.  the schema of the database object XML Schema and … Continue reading

Posted in SQL, XML, XML Schemas | Leave a comment

modifying data in XML a really clunky solution. (no I mean REALLY Clunky)

If you are trying to replace the value of an element that does not exist if can be problematic, i have not found a nice way to do this, if any one does please let me know. So to get … Continue reading

Posted in XML | 2 Comments

being silly with spatial data

Okay, a fun post with no educational value (sort of). My Adopted Twin, also a Database geek, has been under the weather recently so to cheer her up I have been playing with spatial data, under her orders to create … Continue reading

Posted in spatial data, SQL | 2 Comments

Schema validation using Reg Ex

One of the most powerful tools that XML in SQL Server brings to the table is Regular expresions. In XML Schemas Regular Expressions are an easy method to validate your data without having to bolt on complex CLR functions to … Continue reading

Posted in SQL, XML | Leave a comment