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
black calculator keys
Calculate Percentiles
Use T-SQL to implement statistical calculations such as percentile and percentile rank.
road sign pointing to success and failure
Combining Distinct and Non-Distinct Aggregates 3
Itzik presents an optimization improvement related to queries that involve both distinct and non-distinct aggregate computations.
small island in the middle of the ocean
Solving Gaps and Islands with Enhanced Window Functions
SQL Server 2012 provides enhanced window functions to help deal with gap and island problems.
merge
MERGE Statement Tips 2
Itzik discusses several tips for using the T-SQL MERGE statement: preventing MERGE conflicts, understanding that the MERGE ON clause isn’t a filter, realizing that the MERGE USING clause is like the FROM clause in a SELECT statement, and referring to source table elements in the OUTPUT clause.
red percentage key on a calculator
Inverse Distribution Functions
Itzik provides pre-SQL Server 2012 solutions to using ordered set functions for computation of percentiles.
Ordered Set Functions
Various types of calculations can be implemented as ordered set functions, although you currently must rely on workarounds to accomplish this task because SQL Server 2012 doesn't support ordered set functions.
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.

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
Dec 16, 2014
Sponsored

Eight SQL Server Signs the Illuminati Exist

Make no mistake about it, the signs that the Illuminati exist are all around us. You can find their markings on our buildings, on our currency and even in our music videos. That’s right, they’re everywhere!...More
Dec 2, 2014
blog

AlwaysOn Availability Groups and SQL Server Jobs, Part 16: Job Synchronization Checkup Logic

With Linked Servers configured to allow cross-host or cross-box communication between the servers you’re using to host your AlwaysOn Availability Groups, it’s time to start looking at some scripts that can be used to regularly check whether or not SQL Server Agent jobs are correctly synchronized across all servers in your topology....More
Abstract illustration of linked SQL Servers
Nov 18, 2014
blog

AlwaysOn Availability Groups and SQL Server Jobs, Part 15: Setting Up Linked Servers

Learn about setting up Linked Server definitions to let two (or more) servers in an AlwaysOn Availability Group talk to each other and check up on job statuses of jobs running on each other....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) ×