fbpx

T-SQL Tag

THE WORLD’S FASTEST RELATIONAL DIVISION SOLUTION

Aware’s SQL Manager, Dwain Camps develops the world’s fastest Relational Division solution. The flexibility of his solution can also solve other relational division problems.  http://bit.ly/1mLZ7mL For those who aren’t that familiar with Relational Division, there are certain databases  problems that are best solved using principals from Relational...

USING THE T-SQL MERGE STATEMENT

In SQL Server 2008, Microsoft added a new SQL query type: the MERGE statement.  This flexible query provides the ability to perform INSERTs, UPDATEs and even DELETEs all within a single statement.  Used in combination with Common Table Expressions (CTEs), this can be a powerful tool...

MANIPULATING DATES AND TIMES IN T-SQL

In SQL 2008, Microsoft introduced some new date and time data types to augment the options available in prior versions.  The full list of these data types with detailed explanations can be found in Microsoft Books on Line (BOL), but we’ll list them here with a very...

CALENDAR TABLES IN T-SQL

In an earlier blog, we covered a type of auxiliary table (the Tally Table) that can provide a lot of querying flexibility if you have one in your database or construct one in-line to your query.  Today we’re going to talk about another: the Calendar table. The...

TALLY TABLES IN T-SQL

The Tally (or Numbers) table is one of the most useful constructs in intermediate-level SQL.  Have you ever written a T-SQL WHILE loop?  How about a CURSOR?  If your answer to either of those questions is yes, you’ve probably been coding some really poor-performing SQL...