Advanced SQL

SQLServerCentral Article

SQL Window Functions Series: NTILE()

  • Article

Unlock the power of SQL's NTILE function with our latest deep-dive article. Learn to segment your data effectively into quantiles for more nuanced analysis, discover common pitfalls and their solutions, and optimize your queries for peak performance.

4.67 (3)

You rated this post out of 5. Change rating

2024-02-03 (first published: )

4,720 reads

SQLServerCentral Article

5 (4)

You rated this post out of 5. Change rating

2023-11-20 (first published: )

11,186 reads

SQLServerCentral Article

Exploring Parameter Sensitive Plan Optimization in SQL Server 2022

  • Article

PSPO (Parameter Sensitive Plan Optimization) is a SQL Server feature that improves query performance by accepting varied data sizes based on the runtime parameter value(s) specified by the customer. It deals with the situation in which a single cached plan for a parameterized query isn't the best option for all potential incoming parameter values. Non-uniform data distributions exhibit this phenomenon. When using PSPO, SQL Server keeps several execution plans for a single query, each one customized for a particular parameter value. With the help of this feature, numerous execution plans for a parameterized query are generated, each of which is tailored for a certain range of parameter values.

You rated this post out of 5. Change rating

2023-07-21

3,840 reads

SQLServerCentral Article

4.9 (10)

You rated this post out of 5. Change rating

2022-07-13

31,714 reads

Technical Article

Create a Tally Function (fnTally)

  • Script

Many people have published high performance, read-less, Inline Table Valued functions that use Itzik Ben-Gan's wonderful "Virtual Numbers Table" to replace WHILE loops and other forms of RBAR. This one is Jeff Moden's version.

4.86 (7)

You rated this post out of 5. Change rating

2019-08-13 (first published: )

7,387 reads

Stairway to Advanced T-SQL

Stairway to Advanced T-SQL Level 3: Understanding Common Table Expressions (CTEs)

  • Stairway Step

A CTE is a temporary result set defined by a simple query, and is used within the execution scope of a single INSERT, UPDATE, DELETE, or SELECT statement. In this article we will explore how to define and use CTE's.

You rated this post out of 5. Change rating

2024-04-03 (first published: )

6,353 reads

Blogs

Better Trigger Design: #SQLNewBlogger

By

I had someone ask me about using triggers to detect changes in their tables....

SQL Server in the Cloud – Are DBAs Still Needed?

By

Things your cloud vendor may not tell you   Here’s a common theme I...

AZ-900: Microsoft Azure Fundamentals – The Ultimate Beginner’s Guide to Cloud Mastery

By

In an era where cloud computing drives innovation, understanding its fundamentals is no longer...

Read the latest Blogs

Forums

Dropping a PK constraint.

By stevec883

I will have to test this next week, but will not have a chance...

SQL - Conditional merge join

By SQL Bee

I want to add a condition in the joining columns part of the merge...

Is there a way to implement ROWS between logic?

By water490

Hi everyone SUM function has the option to select ROWS BETWEEN parameter to allow...

Visit the forum

Question of the Day

What is Between?

I have a table of products in SQL Server 2022. There are sequential items in the table with ProductIDs of 1, 2, 3, 4, 5, 6, 7, 8, 9, 10. If I run this code, how many rows are returned?

SELECT *
FROM dbo.Products
WHERE ProductID
BETWEEN 4 AND 7;

See possible answers