Home > Query, SQL > BISQL # 34 :What is Identity IN SQL {Identity Part–I}

BISQL # 34 :What is Identity IN SQL {Identity Part–I}

 

Hi Friends,

We often use Identity Column in SQL Server DB,Lets go through each and every aspect of Identity

image

Some Facts about Identity :
  • The IDENTITY property makes generating unique values easy.
  • IDENTITY is not data type.
  • IDENTITY is a column property.
  • IDENTITY make column unique throughout
  • Oracle does not support Identity Smile
Example for Identity

Ex: CREATE TABLE IdentityDemo(IdentityDemo_id smallint IDENTITY NOT NULL, IdentityDemo_name VARCHAR(50) NOT NULL)

In above example the system function @@IDENTITY contains the last identity value used by the connection.

Setup for Identity

If you are designing table in SSMS then its very easy to make identity column

Step 1- Select Column that you want to make as identity

Ex:Lets say I have audit table and I wan make AuditID as my identity column as shown below

image 

Stpe 2:After Selecting AuditID move to column properties

image

Step 3 : Now search identity Tab

image

Step 4: Open this tab and make IS Identity fields as Yes as shown

Before

image

After making Yes

image

And don’t forget to click on save details of table

We will have some more aspect on Identity in upcoming post

For more interesting find on related topic on daily basis you can visit my link resource website :Link Resource # 11 August 1 – August 2 « Dactylonomy of Web Resource

Hope this helps !!

 

For more interesting information on SQL we can also look into similar topics such as

· BISQL # 35 : Deep dive into Identity Functions in SQL {Identity Part–II}

· BISQL # 36 : Queries to Understand more on Identity aspect {Identity Part–III}

· BISQL # 37 :Checking, Seeding and Reseeding of Identity {Identity Part–IV}

· BISQL # 38 : Introduction To Function – {SQL Server Function Part – I }

· BISQL # 39 : Details of Row set functions – {SQL Server Function Part – II}

 

Hope you will like this post on Identity IN SQL Part I.

If you really like reading my blog and understood at least few thing then please don’t forget to subscribe my blog.

If you want daily link and analysis or interesting link go to following website which will give @ your inbox please subscribe our following link resource blog : Link Resource Website

                 For More information related to BI World visit my Mentalist Blog

                           Link Resource Blog >> Daily Interesting links

                           SQL Server Mentalist >> SQL Learning Blog

                           Business Intelligence Mentalist >> BI World

                                          Connect With me on

              | FaceBook |Twitter | LinkedIn| Google+ | WordPress | RSS |

                                      Copyright © 2011 – 2012 Vishal Pawar

Advertisement
Categories: Query, SQL

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: