Click here to Skip to main content
15,890,609 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
10 field in my table now i want to add another column in my table with sequance numbering.
strictly increment one by one
Posted
Comments
Nelek 7-Oct-13 9:51am    
Perfect, you have our permission, go ahead.

Since you didn't ask any question, it is difficult to give you a better answer.

I strongly recommend you to read:
How to ask a question[^] and What have you tried?[^]

 
Share this answer
 
 
Share this answer
 
You can add the new column as Identity field. In case the Identity already exists . while adding the record in the table, you will have to do the below:

SQL
DECLARE @MAX AS INT
SELECT @MAX = ISNULL(MAX(NEWCOLUMN) + 1,1) FROM TABLE_1

INSERT INTO TABLE_1 (NEWCOLUMN, EXISTINGCOLUMN)
VALUES (@MAX,'TEST')
 
Share this answer
 
A Simple steps to solve your problem,

1.Open Table in design view and select a column you want set identity .
2.Now,You can see Column Property in bottom of your screen .
3.Select Identity specification link (+ Sign) this will change the value to 'yes' .
4.set both Identity increment and identity seed to '1' .
5.Save your table



done...
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900