Specify type on SQL Server Computed Column
You should be able to CAST
to your preferred data type inside the CASE
:
...IS NULL THEN CAST(0 as BIT) ELSE CAST(1 as BIT) END
Or slightly simpler...
IsActive AS CONVERT(BIT, CASE ... END) PERSISTED
You should be able to CAST
to your preferred data type inside the CASE
:
...IS NULL THEN CAST(0 as BIT) ELSE CAST(1 as BIT) END
Or slightly simpler...
IsActive AS CONVERT(BIT, CASE ... END) PERSISTED