5
Answers

Adding constraint to varchar type column

Ask a question
Nethra R S

Nethra R S

13y
1.5k
1
Hi,

I have a table as below

CREATE TABLE [dbo].[tblLocationMaster](
  [LocationID] [int] IDENTITY(1,1) NOT FOR REPLICATION NOT NULL,
  [LocationName] [varchar](50) NOT NULL,
  [Description] [varchar](500) NULL,)


I want to add a constraint on LocationName so that duplicate values do not get saved in table... How to do this?

Answers (5)