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 - Join Better Performance - LEFT JOIN or NOT IN?

SQL SERVER – Join Better Performance – LEFT JOIN or NOT IN?

April 22, 2008
Pinal Dave
SQL Performance
SQL Joins, SQL Scripts, SQL Server

LEFT JOIN or NOT IN: which one gives Join Better Performance? It depends on the data. Compare the two queries and their execution plans on AdventureWorks.

Read More
Gouache painting: seen from above, three furrows lie side by side: one long, one shorter, one long

EOMONTH: Month Ends Are Different From DATEADD Month Clipping

April 21, 2008
Pinal Dave
SQL Tips and Tricks
SQL DateTime, SQL Function, SQL Scripts, SQL Server

EOMONTH gives me a month-end date when that is the actual reporting requirement. DATEADD moves a date by a month. These operations can agree for one step and disagree on the next.

Read More
SQL SERVER - 2008 - Row Constructors - Load Temp Tables From Stored Procedures

SQL SERVER – 2008 – Row Constructors – Load Temp Tables From Stored Procedures

April 16, 2008
Pinal Dave
SQL Tips and Tricks
SQL Scripts, SQL Stored Procedure

Load temp tables from stored procedures with a simple INSERT INTO EXEC instead of a loopback OPENQUERY. Here is the before and after code.

Read More
Gouache painting: four identical wooden pizza peels lean against a flour-dusted shelf edge, each steeper than the last

TAN: Keep the Angle Away From Its Undefined Point

April 15, 2008
Pinal Dave
SQL Tips and Tricks
SQL Datatype, SQL Function, SQL Scripts, SQL Server

TAN reads radians and returns float. These safe angles demonstrate sign and magnitude while explaining why a large finite float near ninety degrees is not a meaningful infinity.

Read More
A perforated brass insert in a rectangular wooden tray beside a vermilion wooden piece on a round tray and a sage bowl.

PATINDEX and CHARINDEX: Pattern or Literal Search

April 13, 2008
Pinal Dave
SQL Tips and Tricks
SQL Function, SQL Scripts, SQL String

PATINDEX and CHARINDEX answer different questions. Compare wildcard patterns with literal searches, preserve NULL, and pin collation for digit ranges.

Read More
SQL SERVER - 2005 - Find Database Collation Using T-SQL and SSMS - Part 2

SQL SERVER – 2005 – Find Database Collation Using T-SQL and SSMS – Part 2

April 11, 2008
Pinal Dave
SQL Tips and Tricks
SQL Scripts, SQL System Table

Reader jwwishart shared another way to find database collation in SQL Server 2005: a one line SELECT of collation_name from sys.databases.

Read More
SQL SERVER - 2005 - Restore Database Using Corrupt Datafiles (.mdf and .ldf) - Part 2

SQL SERVER – 2005 – Restore Database Using Corrupt Datafiles (.mdf and .ldf) – Part 2

April 10, 2008
Pinal Dave
SQL Tips and Tricks
SQL Backup and Restore, SQL Data Storage, SQL Function, SQL Scripts

A last resort for corrupt datafiles with no backup: emergency mode, single user, then DBCC CHECKDB with repair_allow_data_loss. Back up the files first.

Read More
Previous 1 … 316 317 318 319 320 321 322 … 365 Next
  • Books
  • Testimonials
  • Privacy Policy

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