Add Primary Key Constraint into table

// When creating table

Use [MBTest]
GO

CREATE TABLE CustomerMaster
(
RowID int NOT NULL,
Name nvarchar(500) NOT NULL,
CONSTRAINT AK_TransactionID Primary Key(RowID)
);
GO

 

// Alter table

Use [MBTest]
GO
ALTER TABLE [dbo].[CustomerDetails]
ADD CONSTRAINT [PK_dbo.CustomerDetails] PRIMARY KEY(RowId)
GO