T-SQLpowered

CREATE TABLE

Create Table with clustered Primary Key on Identity column: CREATE TABLE [dbo].[SampleTable] ( [Id] INT IDENTITY (1,1) NOT NULL, CONSTRAINT [PK_SampleTable] PRIMARY KEY CLUSTERED ([Id]) )  

Read more
T-SQLpowered

ALTER TABLE

Add New Column: ALTER TABLE [dbo].[SampleTable] ADD [NewColum_1] NVARCHAR(MAX) — will be added as NULLable ALTER TABLE [dbo].[SampleTable] ADD [NewColum_1] NVARCHAR(MAX) NULL ALTER TABLE [dbo].[SampleTable] ADD [NewColum_1] NVARCHAR(MAX) NOT NULL Add Primary Key: ALTER TABLE [dbo].[SampleTable] ADD CONSTRAINT PK_Sample_Table PRIMARY KEY CLUSTERED (Id) Change data type for Primary Key column…