07-31-2023, 09:36 AM
Add a new column to a table:
ALTER TABLE [table]
ADD Column1 Datatype
**For example,**
ALTER TABLE [test]
ADD ID Int
If the user wants to make it auto incremented then:
ALTER TABLE [test]
ADD ID Int IDENTITY(1,1) NOT NULL
ALTER TABLE [table]
ADD Column1 Datatype
**For example,**
ALTER TABLE [test]
ADD ID Int
If the user wants to make it auto incremented then:
ALTER TABLE [test]
ADD ID Int IDENTITY(1,1) NOT NULL