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 of a harbor anchor chain broken in two by a missing link, with the lone link painted red

CONCAT_NULL_YIELDS_NULL and CONCAT: How NULL Behaves in Strings

May 12, 2013
Pinal Dave
SQL Tips and Tricks
SQL Function, SQL NULL, SQL Scripts, SQL Server

The CONCAT_NULL_YIELDS_NULL setting decides whether a string plus NULL returns NULL. The CONCAT function never looks at it and treats NULL as an empty string. This post tests both on a customer table, shows the errors the OFF setting causes, and gives safe patterns for names and numbers.

Read More
A checkout belt with three groups of groceries split by red divider bars

GO Is Not T-SQL: Batches, Variable Scope and GO With a Count

May 11, 2013
Pinal Dave
SQL Tips and Tricks
Batch, SQL Scripts, SQL Server, sqlcmd

Learn why GO is not T-SQL, how batches reset variable scope, what GO 3 repeats, and how applications should send scripts safely.

Read More
SQL SERVER - Adding Column Defaulting to Current Datetime in Table

SQL SERVER – Adding Column Defaulting to Current Datetime in Table

May 10, 2013
Pinal Dave
SQL Tips and Tricks
SQL DateTime, SQL Scripts, SQL Server

How do you add a column that fills in the current datetime when a row is inserted? A sample table and a column with a default value that does it for you.

Read More
SQL SERVER - RESEED Identity Column in Database Table - Rest Table Identity Value - SQL in Sixty Seconds #051

SQL SERVER – RESEED Identity Column in Database Table – Rest Table Identity Value – SQL in Sixty Seconds #051

May 8, 2013
Pinal Dave
SQL Video
Database, SQL Identity, SQL in Sixty Seconds, SQL Scripts

Episode 51 of SQL in Sixty Seconds shows how to RESEED identity column values to a number higher, or even lower, than the current one.

Read More
A lazy susan with seven colored bowls, including a red one, around a ring.

Weekday Logic That Works Under Any DATEFIRST Setting

April 27, 2013
Pinal Dave
SQL Tips and Tricks
SQL DateTime, SQL Function, SQL Scripts, SQL Server

Make weekday logic independent of DATEFIRST with a normalized offset or a known Monday, then test every date in a full year.

Read More
Gouache painting of two crates of pears, one holding duplicates with a red pear and one holding only single pears

UNION vs UNION ALL in SQL Server: What Each One Does

April 26, 2013
Pinal Dave
SQL Tips and Tricks
SQL Distinct, SQL Scripts, SQL Server, SQL Union clause

UNION vs UNION ALL comes down to duplicates: UNION removes them and UNION ALL keeps every row. This post tests both on two small store tables. It also covers sorting, a total row at the bottom, mixed operators and data type rules.

Read More
Execution plan with SQL query and cost estimates.

SQL SERVER – Return Specific Row to at the Bottom of the Resultset – T-SQL Script – Part 2

April 25, 2013
Pinal Dave
SQL Tips and Tricks
SQL Scripts, SQL Union clause

Part 2 on how to return a specific row at the bottom of the resultset. Earlier I used CASE in ORDER BY, and this time I show the UNION ALL method.

Read More
Previous 1 … 188 189 190 191 192 193 194 … 366 Next
  • Books
  • Testimonials
  • Privacy Policy

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