hello frinnds, i am new to this forum.........afte seeing this i feel it is gonna helpme.....

right now my problem is->

i am usin msql, here i am using a table in a database..inside this table i have field called ID, i want autoincrement feature for this field......... i don have much knowledge in mssql, hope u people help me.......:confused:

12 Years
Discussion Span
Last Post by gani

If you create the table in Enterprise Manager or Visual Studio there is a list of properties for esach column you create, three of them are called identity (yes,no) identity seed (what number to start from) and increment (the step, or how much to increment by when creating each new record)

These properties are unavaliable unless you set the columns data type to a numeric one like int or decimal.

Search the Books Online manual that comes with MS SQL for IDENTITY it will tell you all about it.

If you script you're tables (which is a good thing to learn) the following is the TSQL for declaring a column to be an identity column.

create table mytable
       [ID] IDENTITY(1,1) Primary Key

the first argument 1 in the parentheses is the seed and the second 1 is the step


thanks buddy.......
hope we continue the same in future

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.