Posts

Showing posts from November, 2016

what is identity column n sql server?

Identity  Column : Identity columns   are commonly used as primary keys in database tables.  These columns automatically assign a value for each new row inserted. This is column property of sql  server. we can use this property when CREATE TABLE OR ALTER TABLE  transact sql statements. Syntax: IDENTITY [ (seed , increment) ] Arguments seed This value is integer value, This value specifies  which value need to start(Starting value/ Is the value that is used for the very first row loaded into the table. ) Is the incremental value that is added to the identity value of the previous row that was loaded. A. Using the IDENTITY property with CREATE TABLE USE AdventureWorks2012;    IF OBJECT_ID ('dbo.new_employees', 'U') IS NOT NULL     DROP TABLE new_employees;  GO  CREATE TABLE new_employees  (   id_num int IDENTITY(1,1),   fname varchar (20),   minit char(1),   ...