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
Table showing various records and their data type.

SQL SERVER – Query to Find Seed Values, Increment Values and Current Identity Column Value of the Table with Max Value of Datatype – Part 2

August 29, 2014
Pinal Dave
SQL Tips and Tricks
SQL Identity

Harsh improved the identity query from Part 1 so it also works when seed values or increment values are not 1. Here is his script.

Read More
Table showing various records and their data type.

SQL SERVER – Query to Find Seed Values, Increment Values and Current Identity Column Value of the Table with Max Value of Datatype

August 27, 2014
Pinal Dave
SQL Tips and Tricks
SQL Identity

Mark Hickin improved my old query, so it now shows seed, increment and current identity column value along with the max value of the datatype.

Read More
A boat keel with boards aligned along it and another small group lying crosswise

Clustered Key Choice for Date Range Queries: Date or Identity

December 14, 2013
Pinal Dave
SQL Tips and Tricks
Clustered Index, SQL DateTime, SQL Identity, SQL Index

Should you cluster on OrderDate? Measure one month of orders on three designs and see what each one costs in reads before you rebuild a table.

Read More
SQL SERVER - How to an Add Identity Column to Table in SQL Server

SQL SERVER – How to Add an Identity Column Using the IDENTITY Property

July 27, 2013
Pinal Dave
SQL Tips and Tricks
SQL Identity

How do you add an identity column to a table in SQL Server? I explain three cases using the IDENTITY property, including why a second one fails.

Read More
SQL Server expected answer.

SQL SERVER – Add Identity Column to Table Based on Order of Another Column

May 30, 2013
Pinal Dave
SQL Tips and Tricks
SQL Identity

A reader wants to add identity column values to an existing table in the order of another column, not the default order. Here is my answer. Do you know a better one?

Read More
Gouache painting of a row of wooden pegs with one red peg, an adjustable guide and empty holes ahead.

Reseed an Identity Column in SQL Server: SQL in Sixty Seconds #051

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

To reseed an identity column, run DBCC CHECKIDENT with the RESEED option. The tests here show which value comes next after existing rows, DELETE and TRUNCATE, and what happens when the new value collides with a key.

Read More
Two hands set a landscape painting into a new wooden frame, the old frame leaning empty.

Adding IDENTITY to an Existing Column With ALTER TABLE SWITCH

May 4, 2013
Pinal Dave
SQL Tips and Tricks
SQL Identity, SQL Server, SQL Table Operation, Table Partitioning

Add IDENTITY to an existing column with an empty matching table, ALTER TABLE SWITCH, a reseed, and full dependency checks.

Read More
Previous 1 2 3 4 5 6 7 Next
  • Books
  • Testimonials
  • Privacy Policy

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