Creating Sequence Numberin sql server 2008

if we have a Query to generate one auto number to one coulmn(Ack__no) when ever one row data is inserted

we do it like this

make the column as int data type in sql serevr 2008 then go to its properties press + in Identity Specifications
then set

    “Is Identity”

to Yes

note the Column should be not null

this will solve the autogeneration problem

// sequence is not available in sql server 2008 or before parts it is in sql server 2011 so the above procedure is used when we have requirement to create sequenc like thing in our table // 😐


About kakani santosh kumar

Working as Software Engineer in Prithvi Information Solutions having 3 years of Experience in Dotnet Framework ranging from 1.1 to 3.5
This entry was posted in Articles, Database and tagged , . Bookmark the permalink.

Leave a Reply

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

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

Google+ photo

You are commenting using your Google+ 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