Scenario: Insufficient permissions (only one user, low privilege, cannot use sp_configure)
Perform
Appendix:
Update backupshopmenu set tempid=midalter table backupshopmenu drop column midexec sp_rename ' backupshopmenu.tempid ', ' MI d ', ' column ' ALTER TABLE backupshopmenu ALTER COLUMN MID int NOT null--If your auto is nullable then you don't need this paragraph.
Online reference:
How to remove the self-growth (identity) of a column with SQL statements
* * Cannot change existing self-increment field to non-self-increment by alter
For example, ALTER TABLE A alter ID int, the self-increment property will not be removed
You can do this by modifying the system table (this method may have unpredictable results, be cautious ...)
sp_configure ' allow updates ', 1
GO
Reconfigure with override
GO
Update syscolumns Set colstat = Colstat & 0x0000
where id=object_id (' table name ') and name= ' field name '
GO
sp_configure ' allow updates ', 0
---------------------------------------------
--A compromise approach
ALTER TABLE a add XXX int
Update a set Xxx=id
ALTER TABLE a drop column ID
exec sp_rename ' xxx ', ' id ', ' column '
---------------------------------------------
How to = "Remove the self-growth of the column without using sp_configure, and retain the original data