This error is generated when trying to create a table with a column calculated from a
Operand type clash: int is incompatible with date
If I comment the calculated column, it works.
(DateInActive)(Date) NULL, -- Date origination (IsValid) AS (IsNull(DateInActive, 1)) -- Failure here
IsValid is simply to return a
bit of ignition | off for this field to indicate no inactive The date has been reported and, if so, is valid.
The column will finally be passed to JSON in a
For JSON exit as a
is-a field for use outside of SQL.
CREATE TABLE (history).(PhoneBook)( (PhoneBookId) (int) IDENTITY(1,1) NOT NULL, (PersonId) (int) NOT NULL, (PhoneId) (int) NOT NULL, (DateActive)(Date) NOT NULL, (DateInActive)(Date) NULL, (IsValid) AS (IsNull(DateInActive, 1)) CONSTRAINT (PK_PhoneBook_1) PRIMARY KEY CLUSTERED ( (PersonId) ASC, (PhoneId) ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON (PRIMARY) ) ON (PRIMARY)