sql - What's the code in turning an ID into an autonumber data type? -


I am using a Visual Studio 2010 and Microsoft SQL Server 2005.

I want my text box to make an auto number data type Equip_No

I have already followed these steps

  Set the property: Identification specification = yes (identity) = yes identification increase = 1 identification seed = 1 < / Code> 

Please help me any kind of gratitude. Thanks!

I do not think you can convert an existing column to identity in Sqlserver-2005. / P>

You can however add a column with identification and then manipulate values ​​and change the seeds

add autoincremental columns

  ALTER TABLE yourtable ADD newid INT identification (1,1)  

It is possible to change your values ​​in your ID column, however you would like

  SET IDENTITY_INSERT  

Manipulate your hands here, example:

  Set up your host New ID =  

Cleaning

  SET IDENTITY_INSERT yourtable off BCC Investigators ( 'YourTable', RESEED, & lt; at least one value from the maximum value & gt;) ;;  

replace the old column

  ALTER TABLE yourtable DROP COLUMN id SP_RENAME 'yourtable.newid', 'id', 'COLUMN'   

Comments

Popular posts from this blog

import - Python ImportError: No module named wmi -

Editing Python Class in Shell and SQLAlchemy -

c# - MySQL Parameterized Select Query joining tables issue -