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

T-SQL Best Practices, Part 2
Itzik continues his discussion of T-SQL best practices; he discusses cloud compatibility, date and time best practices, the importance of writing in a standard way, and performance-related best practices.
illustration of computer code with man's face in background
T-SQL Best Practices, Part 1
Some T-SQL best practices include thinking in a relational way, always remembering NULLs and the three-valued-logic, realizing the full implications of using the NOLOCK hint and therefore avoiding it, and adopting good coding practices.
Example to demonstrate an actual SQL Server execution plan
Understanding Query Plans 2
A key element in query tuning is using the execution plan to determine the reasons for poor query performance. SQL Server provides rich information about query plans in the graphical as well as XML forms of plans.
SQL Server 2012: How to Write T-SQL Window Functions, Part 3 1
Itzik wraps up his discussion of SQL Server 2012's window functions by focusing on optimization.
percentage sign in the clouds
T-SQL Challenge - January 18, 2012

If you're looking for a good querying challenge, try to come up with your own solutions to computing PERCENTILE_CONT and PERCENTILE_DISC for a given input argument @pct. Here's how standard SQL defines the computations when applied as ordered set functions:

Microsoft SQL Server 2012: How to Write T-SQL Window Functions, Part 2 1
SQL Server 2012 enhances support for window aggregate functions. In part 2 of this series, Itzik discusses window offset functions and window distribution functions.
How to Use Microsoft SQL Server 2012's Window Functions, Part 1 5
In this article, Itzik introduces the concept of windowing; he describes the elements involved in window specifications, and he covers window aggregate functions.
T-SQL String Manipulation Tips and Techniques, Part 2
Itzik explains how to handle type conversions when you need to convert a character string value to another type, in both SQL Server 2008 and SQL Server Denali.
colorful balls of string
T-SQL String Manipulation Tips and Techniques, Part 1
Learn about some common string manipulation tasks, such as counting occurrences of a substring within a string, verifying an exact number of occurrences of a substring within a string, and replacing multiple contiguous spaces with a single space.
Indiana automobile license plate
Use T-SQL to Generate a Sequence 1
Itzik presents a real-world T-SQL challenge that involves generating a sequence of license plates.
man typing on computer keyboard with data in the background
SQL Server 2005's Apply, Part 1
The APPLY table operator accepts two table expressions as input and applies the right table expression to each row from the left, allowing correlations from the right table expression to refer to attributes from the left side.
How to Determine the Default Cache Value in SQL Server Denali 1
In the current implementation of SQL Server 2012 (formerly code-named Denali), sequences use a cache value of 50 by default—however, this information isn’t officially documented anywhere because Microsoft wants to preserve the right to change it. So, how can you tell what the current cache value is?
Sequences, Part 2
SQL Server Denali’s sequences feature provides several advantages over the IDENTITY column property. Learn how to cache sequence values, obtain a range of sequence values, and produce multiple unique sequence values in the same target row.
man planning database
T-SQL Foundations: Thinking in Sets
Itzik discusses the foundations of set theory and explains why it’s important to think in terms of sets when addressing querying tasks rather than thinking in iterative or cursor terms.
man typing on keyboard with database servers in background
Sequences, Part 1
SQL Server 2012 provides support for sequences, which are more flexible than the IDENTITY column property and offer several advantages over IDENTITY.

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
Fort in the road
Oct 22, 2014

AlwaysOn Availability Groups and SQL Server Jobs, Part 11: A Fork in the Road

A quick overview of the pros and cons of dynamic detection at job execution time or the option of dynamically enabling/disabling jobs....More
business people around a table and laptop
Oct 9, 2014

AlwaysOn Availability Groups and SQL Server Jobs, Part 10: Dynamic Detection Gotcha #3

You can interject a SQL Server Job Step into your Jobs and have this new/injected Job Step do some checking for you. Here's a look at everything that’s involved in such an approach....More
Man holding a piece of paper with the word GOTCHA
Oct 7, 2014

AlwaysOn Availability Groups and SQL Server Jobs, Part 9: Dynamic Detection Gotcha #2 3

Given that a USE statement is parsed before code is actually run, there are a few options that could be used as a around when it comes to detecting whether or not code should be run....More
SQL Server Pro Forums

Get answers to questions, share tips, and engage with the SQL Server community in our Forums.

Sponsored Introduction Continue on to (or wait seconds) ×