I've this table here. I;mtring to make computed key as primary key
I can't do it. Is it possible to make computed key a primary key
CREATE TABLE [dbo].[tbltest](
[menuCode] [varchar](150) NOT NULL,
[moduleCode] [varchar](150) NULL,
[menuName] [varchar](150) NULL,
[menuSource] [nvarchar](500) NULL,
[active] [bit] NULL,
[ParentCode] AS moduleCode + '-' + menuCode NOT NULL Primary key,
)error:
Only UNIQUE or PRIMARY KEY constraints can be created on computed columns, while CHECK, FOREIGN KEY, and NOT NULL constraints require that computed columns be persisted.