Archive for the ‘SQL’ Category

SQL Server XQuery: deleting nodes using .modify()

Quick blog post; got asked today by a developer friend of mine about how to delete nodes in an XML fragment using the .modify() method.  After some head-scratching and some fumbling around (its been a few months since I’ve done any work with XML), we came up with a version of the following script: DECLARE […]

March 10, 2014 · stuart · No Comments
Tags: , ,  · Posted in: SQL, SQL Server, SQLServerPedia Syndication, XML

Back on the trail…. #sqlsatnash

I realize that I should probably be blogging about my New Year’s resolutions, but meh… I’ve been super busy surviving the holidays.  So busy in fact that I’ve failed to mention that I’ll be presenting at the SQLSaturday in Nashville on January 18, 2014.  I actually got selected to present TWO topics, which is HUGE […]

January 6, 2014 · stuart · No Comments
Tags: , , , , ,  · Posted in: Conferences, SQL, SQLServerPedia Syndication

SQL Server XQuery: Functions (sql:variable() & sql:column())

  Like most query languages, XQuery has several functions that can be used to manipulate and query data.  SQL Server’s implementation supports a limited subset of the XQuery specification, but there’s a lot of power in the functions provided.  I hope to cover some of those functions in more detail at a later date, but […]

October 4, 2013 · stuart · No Comments
Tags: , ,  · Posted in: SQL, SQL Server, SQLServerPedia Syndication, XML

SQL Server XQuery: .modify() method

Continuing with XQuery, today’s post addresses the .modify() method against the xml data type; this method is used to update XML documents by applying one of three XML DML statements (insert, delete, or replace) via the use of a SQL SET statement.  Again, the idea is hand off the work between the XML engine and […]

October 3, 2013 · stuart · No Comments
Tags: , ,  · Posted in: SQL, SQL Server, SQLServerPedia Syndication, XML

Cleaning up orphaned users in SQL Server

Short blog post here; I’m working with my team to clean up some older SQL Servers, and we’re removing several logins that have been dormant or disabled for some time.  Removing the logins is easy, but it leaves orphaned users in several of our databases.  I created the script below to cycle through each of […]

October 2, 2013 · stuart · 4 Comments
Tags: , ,  · Posted in: SQL, SQL Server, SQLServerPedia Syndication

SQL Server XQuery: .value() method

Back to XQuery; the third method I wanted to discuss in this series is the .value() method. Like the .query() method, .value() bridges the SQL Server database engines and XQuery engines by extracting information from an XML document.  The difference is that while .query() returns XML, .value() translates the specific information requested into a scalar […]

July 17, 2013 · stuart · One Comment
Tags: , ,  · Posted in: SQL, SQLServerPedia Syndication, XML

#TSQL2sDay.. For Whom Do You Log?

This month’s T-SQL Tuesday is being hosted by Aaron Nelson [blog | twitter]; since I’m posting this late in the day, I got a chance to sneak a peek at some of the other entries, and most of them were great technical discussions on how to log, what to log, and why you should log.  […]

June 12, 2012 · stuart · No Comments
Posted in: SQLServerPedia Syndication, TSQL2sDay

#SQLSat111 “Biggish Data”

Trying not to be to obnoxious about this, but I’m presenting on “Biggish Data” at SQL Saturday 111 in Atlanta tomorrow; if you’re there, swing by and see me.  I presented this on Monday at AtlantaMDF, and am attempting to incorporate the feedback from that presentation into this one.  Should be good, but I’m still […]

April 13, 2012 · stuart · No Comments
Posted in: Conferences, SQL, SQLServerPedia Syndication

#TSQL2sDay 28–Jack of All Trades, Master of None

This month’s topic was chosen by Argenis Fernandez (blog | twitter): "Jack of All Trades, Master of None?".  It’s interesting to me lately because I seem to keep encountering blog posts and articles that ask some variant of this question.  I’m not sure if it’s spurred in part by the recent release of SQL Server […]

March 13, 2012 · stuart · No Comments
Posted in: SQLServerPedia Syndication, TSQL2sDay

Quick and Easy SQL Script

I haven’t been blogging enough lately, so I’m going to try something new to get past this mild case of writer’s block.  Instead of trying to do a long, in-depth post on some esoteric subject, I’m going to just put out a simple SQL script.  This one’s a bit of a hack, but you’ll see […]

February 2, 2012 · stuart · No Comments
Posted in: SQL, SQLServerPedia Syndication