I have just added a computed column to a table, and it is showing up as an int and I'd like to make it a bit is this possible? I'm having a hard time finding any info on this. Below is the computed column:
IsActive AS case when DateDecommissioned is null then 0 else 1 end PERSISTED
CASTin there for the results? i.e.CAST(1 as BIT)? – JNK♦ Feb 8 '12 at 21:45CONVERT([bit], (0), (0))seems to work well. Thanks. Post as an answer? – Nate Feb 8 '12 at 22:03PERSISTED? – Martin Smith Feb 8 '12 at 22:05PERSISTEDis not required for indexing? Maybe I misunderstood what I read about the limitations. – Nate Feb 8 '12 at 22:07bitcolumn won't be used unless heavily skewed. Are you on 2008? You could look into filtered indexes. – Martin Smith Feb 8 '12 at 22:08