This month's discount Comprehensive Database Performance Health Check · Testimonials
SQLAuthority with Pinal Dave
Home
  • Consulting
    • Health Check
  • Free Videos
  • All Articles
    • AI
    • SQL Performance
    • SQL Tips and Tricks
    • Interview Questions and Answers
    • SQL Puzzle
    • SQL Video
    • SQLAuthority News
    • Personal
  • Books
  • Consulting
SQL SERVER - 2008 - Introduction to Policy Management - Enforcing Rules on SQL Server

SQL SERVER – 2008 – Introduction to Policy Management – Enforcing Rules on SQL Server

June 13, 2008
Pinal Dave
SQL Tips and Tricks
Policy Management, SQL Coding Standards, SQL Scripts, SQL Server

Use Policy Management in SQL Server 2008 to enforce rules, not just list them. A short tutorial that blocks any stored procedure created without the usp prefix.

Read More
Six unmarked stone tiles in a row in front of a plain wooden strip.

DATETRUNC: Use ISO Week Boundaries With Explicit Date Types

June 12, 2008
Pinal Dave
SQL Tips and Tricks
SQL DateTime, SQL Function, SQL Scripts, SQL Server

DATETRUNC can give an ISO week its Monday boundary without changing session settings. I also keep the input date type explicit. A boundary calculation should reveal both its calendar rule and its return type.

Read More
Slate-blue and sage ribbon loops around a wooden spindle, with a cream loop and vermilion end.

STRING_AGG Order: Keep NULLs and Type Width Visible

June 11, 2008
Pinal Dave
SQL Tips and Tricks
SQL Function, SQL Group By, SQL Server, SQL String

STRING_AGG order belongs inside WITHIN GROUP. This example preserves duplicate labels, shows how NULL differs from empty text and casts to nvarchar(max) before aggregation.

Read More
Gouache painting: under a market awning two wicker baskets of apricots stand apart

HAVING Without GROUP BY: Filter One Implicit Aggregate Group

June 10, 2008
Pinal Dave
SQL Tips and Tricks
SQL Function, SQL Reports, SQL Scripts, SQL Server

HAVING without GROUP BY filters the single implicit aggregate group produced by the query. I use that distinction when a summary should appear only if its aggregate condition passes. A false condition can remove the summary row entirely.

Read More
A figure kneels at the edge of a frozen pond, testing the ice with a long pole before crossing.

When to Upgrade: RTM, First CU or Later

June 9, 2008
Pinal Dave
SQL Tips and Tricks
Cumulative Update, DBA, SQL Migration, SQL Server, SQL Upgrade

Decide When to Upgrade SQL Server by weighing new features, early defects, support needs, and evidence from your own workload.

Read More
The same two sieve frames appear in reversed positions in adjacent workshop channels.

SQL SERVER – Order of Conditions in WHERE Clause

June 8, 2008
Pinal Dave
SQL Tips and Tricks
SQL Scripts, SQL Server

Conditions in a WHERE clause don’t define a short-circuit evaluation sequence. I inspect actual behavior instead of relying on text order.

Read More
SQL SERVER - PIVOT and UNPIVOT Table Examples

SQL SERVER – PIVOT and UNPIVOT Table Examples

June 7, 2008
Pinal Dave
SQL Tips and Tricks
PIVOT and UNPIVOT, SQL Joins, SQL Scripts

If you PIVOT a table and then UNPIVOT it, do you get the original back? Not always. My PIVOT and UNPIVOT table examples show why aggregation loses data.

Read More
Previous 1 … 753 754 755 756 757 758 759 … 841 Next
  • Books
  • Testimonials
  • Privacy Policy

© 2006 – 2026 All rights reserved. pinal @ SQLAuthority.com