Category: Code Writing

Turning Tables: SQL Cross Apply vs Table Pivot

Ars Electronica 2013 - Quotidian Record

I find the syntax of CrossApply more elegant and easier to use than UnPivot. See for your self in this sample below. Let me know which one you prefer. /* Proof of concept for pivoting table with cross apply. Autjor:

SQL Removing Duplicate Records

Records_Saturated

Removing duplicate Records in TSQL is likely to be a unique situation every time but there are enough consistent characteristics to the task that we can standardize some of it.  I certainly would not want a one-button-click solution because that

IsInt and IsDecimal from IsNumeric

FortuneCookieNumbers

In TSQL IsNumeric evaluates data to see if it can be cast as any of ten numeric types of data: int, numeric, bigint, money, smallint, smallmoney, tinyint, float, decimal, real. The problem is that most of the time what we

TSQL Multiple Column Where In Sub-Query Filter

Spiral staircase. Vienna, Austria, Western Europe.

Sometimes we want to filter query results based on results from multiple fields from a sub-query or in a where clause but if you try this you’ll get and error message: Only one expression can be specified in the select

Horizontal Self Table Join

dovetail_001_cropped

Union tables join tables vertically, which is fine if you want one long set of data returned, but what if you want to compare data side-by-side in one table horizontally? And what if your are trying to conserve space by

Hello My Name is T500 B634

Hello-my-name-is T500-B634

The SOUNDEX function in SQL, analyzes the phonetics of a given string of text and returns a value which can then be used to find similar values thus searching through text for similar sounding strings. The algorithm is actually a

Ternary Operator Tutorial Examples – Ruby, JavaScript and VB

Fork-in-the-Road

My favorite snippet of programming code is the ternary operator used to handle a Boolean evaluation (true/false). It is concise no matter which language Ruby, JavaScript or VB.net. Anatomy of the Ternary operator: A ternary is a two-step conditional method;

Cambro Face Off Re-Skin Project

Cambro before and after reskinning

This project, Face Off, derives its title from the popular John Travolta, Nicolas Cage movie of the same name. Basically, we re-skinned the Cambro site without touching the internal code and functionality. Cambro is a global manufacturing company for the

Top