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 - Datetime Function TODATETIMEOFFSET Example

SQL SERVER – Datetime Function TODATETIMEOFFSET Example

July 16, 2010
Pinal Dave
SQL Tips and Tricks
SQL DateTime, SQL Function, SQL Scripts, SQL Server

A quick example of the datetime function TODATETIMEOFFSET in SQL Server, and how it differs from SWITCHOFFSET when offsets change.

Read More
A figure with a metal detector digging at the first spot near the dunes, a vast unexplored beach beyond.

Row Goals: Why TOP and EXISTS Change the Plan

July 14, 2010
Pinal Dave
SQL Performance
Execution Plan, Query Hint, SQL Performance, SQL Server, SQL Top

Inspect row goals from TOP and EXISTS, read EstimateRowsWithoutRowGoal, and compare a targeted optimizer hint using actual plans.

Read More
Three wooden gauges with finite end stops and fitted measuring bars in a sunlit workshop.

Unsigned Integers: Safe Type and Range Mapping

July 12, 2010
Pinal Dave
SQL Tips and Tricks
SQL Constraint and Keys, SQL Datatype, SQL Migration, SQL Server

Map unsigned integers to SQL Server types without narrowing their range. Keep strict source-text validation separate from destination CHECK constraints.

Read More
Gouache painting of an open parcel with a loose red ribbon and blank receipt, illustrating INSERT OUTPUT before commit.

SQL Server: Why INSERT OUTPUT Does Not Prove a Commit

July 9, 2010
Pinal Dave
SQL Tips and Tricks
SQL Scripts, SQL Server, SQL Transactions

INSERT OUTPUT can return an identifier before a transaction commits. These tested examples show a rollback after a returned row and a pattern that returns results after commit.

Read More
Gouache painting: four pairs of cherries hang joined at the stem on a wooden rail

SUBSTRING Binary: Count Bytes Rather Than Characters

June 30, 2010
Pinal Dave
SQL Tips and Tricks
SQL Datatype, SQL Function, SQL Server

SUBSTRING binary offsets use byte units. Keep text slicing separate from encoded payload slicing and retain empty and missing cases.

Read More
SQL SERVER - Default Statistics on Column - Automatic Statistics on Column

SQL SERVER – Default Statistics on Column – Automatic Statistics on Column

June 28, 2010
Pinal Dave
SQL Tips and Tricks
SQL Joins, SQL Scripts, SQL Server

Does a column need an index to have statistics? No. A quick demo shows automatic statistics on column data when AUTO_CREATE_STATISTICS is on.

Read More
Two trays pair a blue bowl with a cream jug and a blue jug with a cream bowl.

Count Distinct Pairs: Keep the Columns Together

June 27, 2010
Pinal Dave
SQL Tips and Tricks
Developer, SQL Distinct, SQL NULL, SQL Server, SQL Sub Query

Count distinct pairs by keeping their columns together. A small T-SQL example shows why concatenated labels can collide. Choose whether incomplete pairs belong in the count.

Read More
Previous 1 … 333 334 335 336 337 338 339 … 416 Next
  • Books
  • Testimonials
  • Privacy Policy

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