Create a new data table, set Userid as the primary key, and automatically increase createtableT_UserLogin (UserIdintnotnullprimarykeyidentity (), UserNamenvarchar (50) notnull, Passvarchar (50) notnull, set Userid as the primary key and automatically grow altertablet
Create a new data table, set Userid as the primary key, and automatically increase create table T_UserLogin (UserId int not null primary key identity (), UserName nvarchar (50) not null, Pass varchar (50) not null) modify a data table that has been created, set Userid as the primary key, and automatically add alter table t
Create a new data table, set Userid as the primary key, and automatically increase
Create table T_UserLogin (UserId int not null primary key identity (1, 1), UserName nvarchar (50) not null, Pass varchar (50) not null)
Modify a data table that has been created, set Userid as the primary key, and automatically grow
Alter table tb alter column id int not null
Alter table tb add constraint pkid primary key (id)
Delete primary key
Declare @ Pk varChar (100 );
Select @ Pk = Name from sysobjects where Parent_Obj = OBJECT_ID ('tb') and xtype = 'pk ';
If @ Pk is not null
Exec ('alter table tb drop' + @ Pk)