April 2016

The join order has been enforced because a local join hint is used – Warning in SQL Server

When we use a local JOIN hint in T-SQL query, sometimes, SQL Server throws a warning message as “Warning: The join order has been enforced because a local join hint is used.“. For example, below is a query with a local join hint: After execution, we will get below warning message with result set: In above code, we are using […]

The join order has been enforced because a local join hint is used – Warning in SQL Server Read More »

Dynamic PIVOT query in SQL Server

PIVOT clause is used to generate cross tab outputs in SQL Server. We put unique data values from a column in the PIVOT clause to render them as multiple columns in aggregation with other columns required in the output. With the help of PIVOT clause, we can transpose the distinct values of a column into multiple columns. However, syntax of PIVOT clause requires these distinct values to

Dynamic PIVOT query in SQL Server Read More »