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
Select from view.

SQL SERVER – ORDER BY Does Not Work – Limitation of the Views Part 1

August 23, 2010
Pinal Dave
SQL Tips and Tricks
SQL Scripts, SQL View

Why ORDER BY does not work in a view: the first limitation of views in my series, shown with an AdventureWorks example. Sort outside the view instead.

Read More
SQL SERVER - Computed Columns - Index and Performance

SQL SERVER – Computed Columns – Index and Performance

August 22, 2010
Pinal Dave
SQL Performance
SQL Index, SQL Scripts

The last article in my series on computed columns looks at index and performance, with a summary of every earlier part on storage and PERSISTED columns.

Read More
Execut Plan Index Size Unsorted.

SQL SERVER – Computed Column – PERSISTED and Storage – Part 2

August 21, 2010
Pinal Dave
SQL Performance
SQL Data Storage, SQL Scripts

Part 2 of my look at the computed column and its effect on storage, with a list of the earlier articles in the series on PERSISTED storage and performance.

Read More
SQL SERVER – Function to Retrieve First Word of Sentence – String Operation

SQL SERVER – Function to Retrieve First Word of Sentence – String Operation

August 20, 2010
Pinal Dave
SQL Tips and Tricks
SQL Function, SQL Scripts, SQL String

A friend asked for a UDF that returns only the first word of a sentence. Here is my script with CHARINDEX and SUBSTRING, and how to turn it into a function.

Read More
Gouache painting of a stone staircase descending into a sunken orchard corner with the first step painted red

Negative Identity Seed and Negative Increment in SQL Server

August 19, 2010
Pinal Dave
SQL Tips and Tricks
SQL Constraint and Keys, SQL Identity, SQL Scripts

A Negative Identity seed lets a column start below zero, and a negative increment makes it count down. This post tests IDENTITY(-1,-1) and IDENTITY(-2147483648,1) on SQL Server 2025, shows gaps after a rollback, DBCC CHECKIDENT, and what to do when an int identity runs out. It also shows SEQUENCE as the flexible alternative.

Read More
Three terracotta bowls, one empty, beside a blue tray with three circular recesses.

CROSS APPLY Aggregate: An Empty Input Can Still Return a Row

August 18, 2010
Pinal Dave
SQL Tips and Tricks
SQL Function, SQL Joins, SQL Scripts, SQL Server

CROSS APPLY aggregate behavior depends on whether the right-side query actually produces a row. I inspect that query before assuming unmatched customers disappear. An aggregate without GROUP BY can return a row even when its input is empty.

Read More
A walker on a hillside at dusk looking over scattered village lights, the nearest one glowing red below the path.

Finding the Nearest Store With the geography Type

August 17, 2010
Pinal Dave
SQL Tips and Tricks
Spatial Database, SQL Index, SQL Server

Find the nearest store with SQL Server geography, validate coordinate order, apply a distance radius, and inspect spatial index use.

Read More
Previous 1 … 632 633 634 635 636 637 638 … 841 Next
  • Books
  • Testimonials
  • Privacy Policy

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