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 in Sixty Seconds #195.

Find Missing Identity – SQL in Sixty Seconds #195

March 3, 2022
Pinal Dave
SQL Video
SQL Identity, SQL in Sixty Seconds, SQL Server

Today, we will discuss a very interesting topic about how to find missing identities from our database table. I have previously blogged.

Read More
Gouache painting of apple trees in an orchard with red apples and a small vermilion peg in the ground beside a lamp post

Gaps in an Identity Column: Find Missing Identity Values

February 28, 2022
Pinal Dave
SQL Tips and Tricks
SQL Identity, SQL Scripts, SQL Server

Gaps in an identity column come from deletes, rollbacks, failed inserts and the identity cache. This post finds them as ranges with LEAD, catches the tail with IDENT_CURRENT and lists single values with GENERATE_SERIES.

Read More
Original vessels and supporting fittings remain preserved beside a replacement drawer.

SQL SERVER – Identity Column is Difficult to Remove

June 16, 2021
Pinal Dave
SQL Tips and Tricks
SQL Identity, SQL Scripts, SQL Server

The IDENTITY property is difficult to remove through a column alteration because SQL Server doesn’t support that operation. Existing values need protection.

Read More
Gouache painting of a spinning cog, a block tower and a toy barn with a vermilion door on a shelf

DBCC CHECKIDENT: Check and Fix the Next Identity Value

May 17, 2021
Pinal Dave
SQL Tips and Tricks
SQL Delete, SQL Identity, SQL Scripts, SQL Server DBCC

DBCC CHECKIDENT reports the next identity value of a table and can change it. This post runs NORESEED, the no-option form and RESEED on a small demo table. It shows how DELETE and TRUNCATE treat the counter, the duplicate key error from a value that is too low, and who may run the command.

Read More
An existing overgrown garden section remains beside newly planted orderly seedlings

How to Add Constraint With No Validation? – Interview Question of the Week #299

October 25, 2020
Pinal Dave
SQL Interview Questions and Answers
SQL Constraint and Keys, SQL Error Messages, SQL Identity, SQL Scripts, SQL Server

Question: How to Add Constraint With No Validation?

Answer: I got this question from one of my clients of who is an Oracle user.

Read More
Gouache painting of three padlocks on a bench, each with a vermilion key in it

Check Constraint on Identity Column: Why Inserts Fail

October 24, 2020
Pinal Dave
SQL Tips and Tricks
SQL Constraint and Keys, SQL Identity, SQL Scripts

A check constraint on identity column values can make every insert fail, because the identity moves on whether or not the row is accepted. This post reproduces the failure, shows that the failed attempts still use up identity values, and lists every such constraint in a database with one query.

Read More
negative identity

Negative Identity Column – SQL in Sixty Seconds #101

August 14, 2020
Pinal Dave
SQL Video
SQL Identity, SQL in Sixty Seconds, SQL Performance, SQL Scripts, SQL Server

I had a very interesting story to tell about a negative identity column from my recent Comprehensive Database Performance Health Check. 

Read More
1 2 3 4 … 7 Next
  • Books
  • Testimonials
  • Privacy Policy

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