An IF inside a check constraint SQL
问题 I have this table.. CREATE TABLE [dbo].[Tipo_Servicios_Info]( [TSI_TS_Id] [int] NOT NULL, [TS_Tar_Id] [int] NOT NULL, [TS_PDI_Id] [int] NOT NULL, [TSI_Descripcion] varchar(100), [TSI_FechaIni] date not null, [TSI_FechaFin] date not null, [TSI_HoraMin] time, [TSI_HoraMax] time, [TSI_Duracion] varchar(50) not null, [TSI_Unidad] varchar(50) not null, [TSI_Cantidad] int not null, CONSTRAINT [PK_TIPO_SERVICIOS_INFO] PRIMARY KEY CLUSTERED ( [TSI_TS_Id] ASC, [TS_Tar_Id] ASC, [TS_PDI_Id] ASC )WITH