Back by popular demand – 50% off our recently released SQL JOIN Types course. >>> Use Coupon Code: 50OFFJOINS <<< What is the difference, and how can you use joins correctly? Sometimes an inner join is the right join type to use, other times the left outer join, right outer join, full outer join, cross join or self join. In …

TSQL JOIN Types Sale Continues Read more »

Just this week the team at Stedman Solutions finished the SQL Server JOIN Types paid training course. I am very excited to complete this and to make it available to the SQL Community. Whether you have been writing SQL Queries for 10 years, or you are on connecting your first 2 tables in a query, there is something that you …

Excited to Release Training Videos Read more »

The OUTPUT clause is often times underappreciated by the TSQL programmer.  There are many really interesting things that you can do with the OUTPUT clause, from inserting to two tables with one statement or to replace the SCOPE_IDENTITY option.  For this posting I am looking into using the OUTPUT clause for auditing. By auditing in this example, I specifically mean …

Using the OUTPUT Clause in TSQL for Auditing Read more »

After the last post on Cumulative Distribution Function (CDF) or as it is known in TSQL CUME_DIST(), I realized that although I showed how to use it, I didn’t really explain what it means, or when to use it.  That is where this example comes in. First lets take an example that generates simulated dice rolls.  What are the odds …

Cumulative Distribution Function (CDF) – Analyzing the Roll of Dice with TSQL Read more »

Percent rank is defined as the number of values that are the same or less than the current value divided by one less than the number of values. Percent rank is different than PERCENTILE, stay tuned for PERCENTILE_DISC and PERCENTILE_CONT which are different from PERCENT_RANK. For this example I will be using the same revenue table in the sample database …

More TSQL Analytic Functions – PERCENT_RANK Read more »

One thing that I end up having to look search on regularly is rounding of dates and times in Transact SQL, having looked this up too many times I finally realized that it is time for me to do my own blog post for it. First off, whats the difference between rounding and truncating in these examples. Rounding rounds to …

TSQL Rounding or Truncating Date Time to Nearest Day, Hour, Minute or Second Read more »

Part of SQL Server running queries is that once a query is analyzed, parsed and compiled, that compiled plan is kept in memory so that it can be quickly re-used in the future. If you are using proper parameterized queries, most of your queries will get kept around and re-used saving lots of CPU and memory on SQL Server. If …

How big is your procedure cache? Read more »

This is part 19 two left outer JOINS of a 19 part series on TSQL Basics. You will first gain an understanding of the differences between each of these types of JOINS, and when they should be used. Then we’ll explore some common uses for JOINS, such as replacing a not in clause with JOIN to get the same results …

TSQL Basics Part 19: TWO LEFT OUTER JOINS – Video Explanation Read more »

This is part 18 “two inner JOINS” of a 19 part series on TSQL Basics. You will first gain an understanding of the differences between each of these types of JOINS, and when they should be used. Then we’ll explore some common uses for JOINS, such as replacing a not in clause with JOIN to get the same results with …

TSQL Basics Part 18: TWO INNER JOINS Read more »