While working with IDENTITY we might want to know the current value of the IDENTITY, the SEED value and the Increment value. So here is the way by which we can quickly get this information.
SELECT IDENT_CURRENT ('customer') AS CurrentIdentity,
IDENT_INCR('customer') AS Incremented_By,IDENT_SEED('customer') AS SeedValue;
--create customer table
CREATE TABLE customer (custid INT IDENTITY NOT NULL,custname VARCHAR(10));
--insert value
INSERT INTO customer(custname) values ('cust1');
--get the Identity values
SELECT IDENT_CURRENT ('customer') AS CurrentIdentity,
IDENT_INCR('customer') AS Incremented_By,IDENT_SEED('customer') AS SeedValue;
Using the above example, I have inserted two records into the customer table. Here is the result of the current Identity values.