kueri SQL untuk membuat kenaikan otomatis kolom yang ada
Alter table table_name modify column_name datatype(length) AUTO_INCREMENT PRIMARY KEY
Adventurous Alligator
Alter table table_name modify column_name datatype(length) AUTO_INCREMENT PRIMARY KEY
CREATE TABLE Persons (
Personid int NOT NULL AUTO_INCREMENT,
LastName varchar(255) NOT NULL,
FirstName varchar(255),
Age int,
PRIMARY KEY (Personid)
);
INSERT INTO Persons (FirstName,LastName)
VALUES ('Lars','Monsen');
CREATE TABLE table_name (
id INT NOT NULL IDENTITY(1, 1),
name NVARCHAR (100) NULL,
school NVARCHAR (100) NULL,
PRIMARY KEY (ID)
);
CREATE TABLE Persons (
Personid int IDENTITY(1,1) PRIMARY KEY,
LastName varchar(255) NOT NULL,
FirstName varchar(255),
Age int
);
CREATE TABLE [dbo].[MY_TABLE] (
[ID] INT NOT NULL IDENTITY(1, 1),
[NAME] NVARCHAR (100) NULL,
[SCHOOL] NVARCHAR (100) NULL,
PRIMARY KEY (ID)
);