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
Gouache painting: a leather sack tipped over a wooden chute pours golden grain into a narrow stoneware crock, which overflows across the bench

SUM Integer Values: Cast Before the Aggregate

June 15, 2007
Pinal Dave
SQL Tips and Tricks
SQL Datatype, SQL Function, SQL Scripts

SUM integer values can exceed int even when each row fits. Cast each input to bigint before aggregation and keep NULL and empty-set behavior visible.

Read More
SQL SERVER - Easy Sequence of SELECT FROM JOIN WHERE GROUP BY HAVING ORDER BY

SQL SERVER – Easy Sequence of SELECT FROM JOIN WHERE GROUP BY HAVING ORDER BY

June 14, 2007
Pinal Dave
SQL Tips and Tricks
Database, DBA, SQL Scripts

The sequence of SELECT, FROM, JOIN, WHERE, GROUP BY, HAVING and ORDER BY that I gave my new hires. Since then they ask me far fewer questions.

Read More
SQL SERVER - Explanation SQL SERVER Hash Join

SQL SERVER – Explanation SQL SERVER Hash Join

June 14, 2007
Pinal Dave
SQL Performance
SQL Joins

How a Hash Join works in two phases, build and probe, why it suits large data sets without indexes, and why it needs an equijoin predicate.

Read More
SQL SERVER - Fix : Error 8629 The query processor could not produce a query plan from the optimizer because a query cannot update a text, ntext, or image column and a clustering key at the same time.

SQL SERVER – Fix : Error 8629 The query processor could not produce a query plan from the optimizer because a query cannot update a text, ntext, or image column and a clustering key at the same time.

June 13, 2007
Pinal Dave
SQL Performance
SQL Error Messages, SQL Server

Error 8629 appears when one UPDATE changes a text or image column and a clustering key together. Here is why SQL Server blocks it and a fix.

Read More
A plain envelope is opened beside a magnifying glass and several blank paper slips.

How to Read a SQL Server Error Message

June 13, 2007
Pinal Dave
SQL Tips and Tricks
Best Practices, Database, SQL Scripts, SQL Server

Read a SQL Server error message by separating its number, severity, state, procedure, and line, then preserve the context needed to investigate.

Read More
SQL SERVER - Recovery Models and Selection

SQL SERVER – Recovery Models and Selection

June 13, 2007
Pinal Dave
SQL Performance
SQL Backup and Restore, SQL Coding Standards, SQL Data Storage, SQL Scripts, SQL Server Security

SQL Server offers three recovery models: full, simple and bulk-logged. Here is when to select each one, based on how much data loss you can accept.

Read More
A wooden mannequin tangled in yarn standing proudly in front of perfectly tidy drawers

Normalization Jokes and the Normal Forms They Make Fun Of

June 12, 2007
Pinal Dave
SQL Tips and Tricks
Best Practices, Database, Normalization, SQL Humor

Normalization jokes are funny because they are true. Here are the classics in my own words, and the first three normal forms they poke fun at.

Read More
SQL SERVER - LEN and DATALENGTH of NULL Simple Example

SQL SERVER – LEN and DATALENGTH of NULL Simple Example

June 12, 2007
Pinal Dave
SQL Performance
SQL Function, SQL NULL, SQL Scripts

A common mistake is checking LEN(@var) = 0 for a NULL value. LEN and DATALENGTH of NULL both return NULL, not zero, as this simple example shows.

Read More
A gouache joinery bench contrasts incompatible grooved pieces with a smoothly matched pair, beside a red checking peg.

SQL SERVER – Cannot Resolve Collation Conflict For Equal to Operation

June 11, 2007
Pinal Dave
SQL Tips and Tricks
Best Practices, SQL Collation, SQL Error Messages, SQL Joins, SQL Scripts, SQL Server

A collation conflict means character expressions use incompatible comparison rules. I choose the intended rules before applying COLLATE.

Read More
SQL SERVER - 2005 T-SQL Paging Query Technique Comparison (OVER and ROW_NUMBER()) - CTE vs. Derived Table

SQL SERVER – 2005 T-SQL Paging Query Technique Comparison (OVER and ROW_NUMBER()) – CTE vs. Derived Table

June 11, 2007
Pinal Dave
SQL Tips and Tricks
SQL Function, SQL Joins, SQL Paging, SQL Scripts, SQL Server

Paging in SQL Server 2005 with ROW_NUMBER: CTE vs. derived table. I compare both methods and show they give the same performance for common queries.

Read More
Previous 1 … 567 568 569 570 571 572 573 … 589 Next
  • Books
  • Testimonials
  • Privacy Policy

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