Recent Posts

Showing the 20 most recent posts.

Jekyll Configurator
March 3, 2015

Example block-level help text here. Legend Example block-level help text here. Label name Example block-level help text here. Check me out Submit  

» Show full post ...

Concatenate Strings in TSQL
February 24, 2015

There several methods for building strings from multiple rows of data, but my favorite uses XML. This approach doesn’t require any loops or temporary variables (which cannot be used within a VIEW). Another benefit is that the resulting query can be used as a subquery, in a common table expression (CTE), or anywhere that a normal query would be used. -- init example data DECLARE @Data TABLE (Id int IDENTITY(1,1), Caption varchar(25)) INSERT INTO @Data...

» Show full post ...

Random Rows in TSQL
February 24, 2015

Sometimes it can be useful to randomly select a value (or row) from a table. One easy way to do this is to sort the table using a column that contains random values, and then select the first row. The following query illustrates this concept. -- initialize example data DECLARE @Data TABLE (Id int IDENTITY(1,1), Caption varchar(25)) INSERT INTO @Data (Caption) SELECT 'Apple' UNION SELECT 'Orange' UNION SELECT 'Banana' UNION SELECT 'Pear' UNION SELECT 'Mango'...

» Show full post ...

Truncate Dates in TSQL
February 24, 2015

There are many times when you want to store a pure date in the database. Examples include date of birth, anniversaries, date of hire, etc… Before the 2008 version of SQL Server, there was no pure date data type. Dates were stored in DATETIME columns. In another sceanrio, you may actually want to store the date and time, but perform queries on just the date part. For example, you may have a LastSeenOn column in...

» Show full post ...

Old Dog, New Tricks
February 18, 2015

Next chapter of my life starts late March. Joining @thoughtworks #Atlanta team. 25 years in the industry, but I’ll be a newbie again. Can’t wait! – @groundh0g The last 25 years have been a wild ride. I’ve both worked for big name companies and played the role of a big fish in small ponds. That time has afforded me the opportunity to work across the nation as I developed my skills, and to return to...

» Show full post ...

Chromebook Home and End Keys
February 12, 2015

When transitioning from Windows to my MacBook Pro around 2009, I lamented the missing Home and End keys. I eventually discovered that the Command+Left and Command+Right combos performed the same action. It’s taken a while, but I’m finally comfortable with the usage. Fast forward to 2014. I got a shiny, new Chromebook from ASUS. Again, the Home and End keys were missing. Not a problem. I’m a pro at Command+Left and Command+Right now. Unfortunately, the...

» Show full post ...