Auto increment
-
I am using auto increment for the primary key in a table. For example, table - (userID, UserName). Now the auto increment of last userId = 10. If I would like to insert a userId = 111, I found that the next auto increment userId must be in 112, but it is not 11. Is there any setting to change back the UserId to 11? Thanks!:)
-
I am using auto increment for the primary key in a table. For example, table - (userID, UserName). Now the auto increment of last userId = 10. If I would like to insert a userId = 111, I found that the next auto increment userId must be in 112, but it is not 11. Is there any setting to change back the UserId to 11? Thanks!:)
hi mimimimilaw you must go to design table ,Set Identity Seed = 10 for column auto increment
-
hi mimimimilaw you must go to design table ,Set Identity Seed = 10 for column auto increment
It maybe 10, 20, 45 or any number. How can I using mssql statement to do this?:)
-
I am using auto increment for the primary key in a table. For example, table - (userID, UserName). Now the auto increment of last userId = 10. If I would like to insert a userId = 111, I found that the next auto increment userId must be in 112, but it is not 11. Is there any setting to change back the UserId to 11? Thanks!:)
Hi, Try this DBCC CHECKIDENT ('tablename',RESEED,110) If u execute the above statement then the next number will be 111. But you cannot set it back to 10, because already 111 exists which is greater than 10. May I know the situation why you need the userid to be 111? Senthil
-
It maybe 10, 20, 45 or any number. How can I using mssql statement to do this?:)
Hi mimimimilaw You can use this statment CHECKIDENT ('tablename',RESEED,10) best Regard Rami Abd Alhalim
-
I am using auto increment for the primary key in a table. For example, table - (userID, UserName). Now the auto increment of last userId = 10. If I would like to insert a userId = 111, I found that the next auto increment userId must be in 112, but it is not 11. Is there any setting to change back the UserId to 11? Thanks!:)
If you need anything i am ready RAmi
-
If you need anything i am ready RAmi
Thanks All, I try to do what I want in other methods.;)