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
A freshly baked loaf leads a row of loaves on a cooling rack

Interview Question of the Week #030 – Retrieve Last Inserted Identity of Record

August 2, 2015
Pinal Dave
SQL Interview Questions and Answers
SQL Identity

Retrieve the last inserted identity of record safely, compare identity functions with a trigger, and capture multi-row values using OUTPUT.

Read More
SQL SERVER - Finding Out Identity Column Without Using Column Name

SQL SERVER – Finding Out Identity Column Without Using Column Name

June 3, 2015
Pinal Dave
SQL Tips and Tricks
SQL Identity

Did you know SELECT $identity finds the identity column without using column name? Here is how it works, and how to check if a table has one.

Read More
Collated nail strip with a defined end beside a loose nail heap

The Last Entered Row: Why a Table Needs an Ordering Column

December 27, 2014
Pinal Dave
SQL Tips and Tricks
SQL DateTime, SQL Identity, SQL Order By

A table has no last row until you define one. Here is how identity, event time and ties give different answers.

Read More
SQL SERVER - Add Auto Incremental Identity Column to Table After Creating Table

SQL SERVER – Add Auto Incremental Identity Column to Table After Creating Table

October 11, 2014
Pinal Dave
SQL Tips and Tricks
SQL Identity, SQL Scripts

Can you add an auto incremental identity column to a table after it is created? The answer is both no and yes, and I show the ALTER TABLE script.

Read More
Error dialog window for truncating data.

SQL SERVER – Reset the Identity SEED After ROLLBACK or ERROR

October 8, 2014
Pinal Dave
SQL Tips and Tricks
SQL Identity

A reader noticed that a failed insert still bumps the identity value. I show how to reset the identity seed after a ROLLBACK or an error.

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 – 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
Previous 1 2 3 4 5 6 7 Next
  • Books
  • Testimonials
  • Privacy Policy

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