Logical Functions – IIF()

I am going continuing my short articles or tidbits on Transaction SQL logical functions. These functions were introduced with the SQL Server 2012 release. Both functions have their origins from Visual Basic for Applications (VBA) framework. I think of these function as decision trees. Especially when they are nested to several levels. If you have a kid like I do, you might find the decision tree for dropped food funny. Please see image to left. I will be exploring the IIF function today. The example below uses the RAND function,…

Logical Functions – CHOOSE()

I am going write a couple of tidbits on Transaction SQL logical functions. These functions were introduced with the SQL Server 2012 release. Both functions have their origins from Visual Basic for Applications (VBA) framework. I think of these function as decision trees. Especially when they are nested to several levels. If you have a kid like I do, you might find the decision tree for dropped food funny. Please see image to left. I will be exploring the CHOOSE function today. If you grew up like I did, you…

SNESSUG – User Group

I am thrilled about presenting to the Southern New England SQL Server User Group (SNESSUG) on June 12, 2013. I always love the home team advantage by knowing the audience very well. It makes for a relaxing environment to teach and attendees to learn. Here is the gritty details of the presentation that I will be exploring during the 90 minute talk.       Topic: Effective Data Warehouse Storage Patterns Abstract: Many companies start off with a simple data mart for reporting. As the company grows, users become dependent…

Operator Precedence

I am going to bring closure to my series of very short articles or tidbits on Transaction SQL Operators. An operator is a symbol specifying an action that is performed on one or more expressions. I will exploring the operator precedence today. In mathematics and computer programming, the order of operations is a set of rules used to clarify which procedures should be performed first in a given mathematical expression. I do not have enough time in this very short article to go over the eight levels that group and…

Unary Operators

I am going to stick to writing my series of very short articles or tidbits on Transaction SQL Operators. An operator is a symbol specifying an action that is performed on one or more expressions. I will exploring the Unary Operators today. In mathematics, a unary operation is an operation with only one operand. Microsoft Transaction SQL has three unary operators: positive, negative, and bitwise not. I have personally used the bitwise operators when dealing with data from car manufacturing devices that use application specific integrated circuits (ASIC). Since the…

String Operators

I am going to press on with my series of very short articles or tidbits on Transaction SQL Operators. An operator is a symbol specifying an action that is performed on one or more expressions. I will exploring the String Operators today. These operators can be broken down into two categories: concatenation and pattern matching. Out of the two operators, pattern matching is the most complex. Transaction SQL has both a simple and compound version of the concatenation operator. This operator takes two strings and combines them into one. Please…

Set Operators

I am going to promote my series of very short articles or tidbits on Transaction SQL Operators. An operator is a symbol specifying an action that is performed on one or more expressions. I will exploring the Set Operators today. A Venn diagram is used to express different operations between sets. The above image represents the four possible operations given two sets, A and B, and three operators. We will get into the operators supported by Microsoft Transaction SQL shortly. To demonstrate these operators, we need a two temporary tables…

Logical Operators

I am going to make headway on the series of very short articles or tidbits on Transaction SQL Operators. An operator is a symbol specifying an action that is performed on one or more expressions. I will exploring the Logical Operators today. In short, these operators return either a boolean TRUE or FALSE. To demonstrate many of these operators, we need a temporary table to query against. The Transaction SQL code below creates a table that contains the first eight prime numbers. Any complex real world programming example probably has…

Compound Operators

I am going to forge ahead with my series of very short articles or tidbits on Transaction SQL Operators. An operator is a symbol specifying an action that is performed on one or more expressions. I will exploring the Compound Operators today. These operators are a short hand for taking a variable @V, applying some operator O and storing the result as variable @V. A long way to write out adding 2 to variable @V is the expression @V = @V + 2 while the short way is the expression…

Comparison Operators – Part 2

I am going pick up writing my series of very short articles or tidbits on Transaction SQL Operators. An operator is a symbol specifying an action that is performed on one or more expressions. I will continue examining the Comparison Operators today. These comparison operators are known as the less than = symbols in inequality and equality mathematics. I will be examining how a sample operator works with character, date/time, money and binary data types. Remember, character data types use the ASCII or UNICODE chart to determine if one character…