Itzik Ben-Gan

Itzik
Ben-Gan

Itzik Ben-Gan is a contributing editor to SQL Server Pro and a cofounder of SolidQ. He teaches, lectures, and consults internationally. He's a SQL Server MVP and is the author of several books about T-SQL, including Microsoft SQL Server 2012 High-Performance T-SQL Using Window Functions (Microsoft Press).

Check out Itzik's Puzzled by T-SQL blog.
Twitter: @ItzikBenGan

Articles
How to Compute Date and Time Difference in Parts 6
Sometimes you need to use T-SQL to compute the time passed between two events whose date and time values you get as inputs. For some purposes, it’s sufficient to compute the difference as a duration in terms of some part. What’s significantly trickier is to compute the difference as a combination of parts.
Identifying Existence of Intersections in Intervals
Identifying the existence of intersections in intervals is a classic task where, given a table with a set of intervals, you need to check whether any intersections exist. This is often done to verify the validity of data that holds intervals that are not supposed to have any intersections between them. For example, when you keep history of changes to rows by maintaining multiple versions of a row, the same row is not supposed to have intersecting versions.
Tips Concerning Temporal Tables
Here are a few tips on working with temporal tables, which were introduced in SQL Server 2016 to enable tracking history of changes to data.
What You Need to Know about DATETIMEOFFSET and SQL Server 2016's AT TIME ZONE Function 4
Time zone related calculations with DATETIMEOFFSET values can get quite tricky. Prior to the introduction of the AT TIME ZONE function the two main tools that we had for time zone conversions were the TODATETIMEOFFSET and SWITCHOFFSET functions.
Logical Query Processing Part 8 : SELECT and ORDER BY 2
Logical query processing defines the conceptual interpretation of queries. A good understanding of this topic is key to writing correct and robust queries.
Logical Query Processing Part 7: GROUP BY and HAVING
This article continues the series about logical query processing, which describes the logical, or conceptual, interpretation of queries.
Logical Query Processing Part 6: The WHERE Clause
Logical query processing describes the conceptual interpretation of SQL queries. This article is the sixth part in a series on the topic.
What You Need to Know about the Batch Mode Window Aggregate Operator in SQL Server 2016: Part 3
The series concludes with coverage of aggregate window functions with a frame, as well as offset window functions.
What You Need to Know about the Batch Mode Window Aggregate Operator in SQL Server 2016: Part 2 2
SQL Server 2016 introduces the batch mode Window Aggregate operator, which dramatically improves the performance of calculating window functions. Besides the general performance advantages of batch mode processing compared to row mode processing, this operator uses a dedicated code path for each window function. Many inefficiencies in the original row mode optimization are removed.
What You Need to Know about the Batch Mode Window Aggregate Operator in SQL Server 2016: Part 1
This month I was scheduled to cover Part 6 of the Logical Query Processing series, but now that SQL Server 2016 has been released, I feel like I have to interrupt that series with a three-part series about an exciting new feature: the batch mode Window Aggregate operator.
Logical Query Processing Part 5: The FROM Clause and UNPIVOT
This article continues the series covering logical query processing, which describes the conceptual interpretation of a query.
Logical Query Processing: The FROM Clause and PIVOT
This article continues the discussion about logical query processing. In Part 1 I provided an overview of the concept. I then started to cover the FROM clause, which is the first major clause that is evaluated logically. In Part 2 I covered joins and in Part 3 I covered the APPLY table operator. This month I continue coverage of the FROM clause--specifically, the logical query processing aspects of the PIVOT table operator.
Logical Query Processing: The FROM Clause and APPLY 6
This article is the third in a series that covers logical query processing. In the first part, I provided an overview of the topic, and in the second part I started covering the FROM clause, focusing on joins. This third part continues the coverage of the FROM clause, focusing on the APPLY operator.
Logical Query Processing: The FROM Clause and Joins 4
Last month I provided an overview of logical query processing. I explained that this term represents the logical interpretation of a query. I provided a sample database called TSQLV4, two sample queries that I referred to as simple sample query and complex sample query, and a graphical depiction of logical query processing as a flow chart. Starting with this article, I delve into the particulars of individual clauses--this time focusing on the FROM clause and the JOIN operator.
Logical Query Processing: What It Is And What It Means to You 9
If I had to name a foundational topic in T-SQL that I felt that was the most important for T-SQL practitioners to know, without a doubt I would say “logical query processing.” A solid understanding of this topic is key to writing correct and robust code.

Digital Magazine Archives

Browse back issues of SQL Server Pro, from January 2007 through the last issue published in April 2014. Find the back issues here.

 

From the Blogs
Sep 15, 2016
Sponsored

Power BI Desktop “Publish to Pyramid Server” Button

Many organizations today cannot use public cloud solutions because of security concerns, administrative challenges and functional limitations. However, they still need a centralized platform where end users can conduct self-service analytics in an IT-enabled environment....More
Jul 6, 2016
Sponsored

Using BI Office Together with Microsoft Power BI Desktop to Unlock Business Insights

It is crucial to move away from data and analytics stored on individual desktop computers. Today’s solutions must promote holistic, collective intelligence. The strong, continued alliance between Microsoft and Pyramid Analytics helps make all this possible....More
Jul 6, 2016
Sponsored

Why It’s Important to Unlock Business Insights Trapped on Individual Desktops

To become a truly data-driven enterprise, many business leaders recognize that they must extend the capabilities of self-service business intelligence (BI) and analytics to more of their business users. Many BI tools tackle part of this need, but they don’t offer a complete enterprise solution....More

Sponsored Introduction Continue on to (or wait seconds) ×