Nethra R S

Nethra R S

  • NA
  • 310
  • 334k

Adding constraint to varchar type column

Sep 19 2011 3:48 AM
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)