Add foreign key constraints
Alter table dbo. account_userrole add foreign key (userid)
References DBO. account_user (userid)
Delete Index
Drop index [user_publish_ischeck] on [DBO]. [user_publish]
Delete primary key
Alter table user_publish drop constraint pk_user_publish
Create an index
Create nonclustered index [user_publish_ischeck] on [DBO]. [user_publish]
(
[Ischeck] ASC
)
-- Create a non-clustered Index
Create nonclustered index inx_entry_stock_on entry_stock_d (entry_stock_bi)
-- Primary key and non-Clustering
Alter table entry_stock_d add primary key nonclustered -- primary key and non-clustered
(
Entry_stock_bi, aid
}
Create a unique non-clustered Index
Create unique index ak_unitmeasure_name
On production. unitmeasure (name );
Go
Create a partition clustered Index
Create clustered index pk_user_publish_reftime
On user_publish (reftime)
On reftimeps (reftime );
Delete Constraints
Alter table [user_publish] Drop constraint df_user_publish_ischeck
Add Constraints
Alter table user_publish
Add constraint df_user_publish_ischeck default (0) for ischeck
Modify column type
Alter table user_publish alter column ischeck char (1) null
Delete Index
Drop index [user_publish_ischeck] on [DBO]. [user_publish]
Delete primary key
Alter table user_publish drop constraint pk_user_publish
Create an index
Create nonclustered index [user_publish_ischeck] on [DBO]. [user_publish]
(
[Ischeck] ASC
)
-- Create a non-clustered Index
Create nonclustered index inx_entry_stock_on entry_stock_d (entry_stock_bi)
-- Primary key and non-Clustering
Alter table entry_stock_d add primary key nonclustered -- primary key and non-clustered
(
Entry_stock_bi, aid
}
Create a unique non-clustered Index
Create unique index ak_unitmeasure_name
On production. unitmeasure (name );
Go
Create a partition clustered Index
Create clustered index pk_user_publish_reftime
On user_publish (reftime)
On reftimeps (reftime );
Delete Constraints
Alter table [user_publish] Drop constraint df_user_publish_ischeck
Add Constraints
Alter table user_publish
Add constraint df_user_publish_ischeck default (0) for ischeck
Modify column type
Alter table user_publish alter column ischeck char (1) null