sql - Select a nullable bit with a default value -


I need to select a null qualified bit column in one view, but whenever the value is null, FALSE Use the default value. (For other reasons, I can not even add a default value to the source table.) This is what I am doing.

  CAST (case when bit_column IS is in the form of 0 bit bitmile and bit) bit_column, ...  

But I am thinking that there is a better / more efficient way to do this.

Isnull function.

  isnull (bit_column, 0)  

Comments

Popular posts from this blog

c# - sqlDecimal to decimal clr stored procedure Unable to cast object of type 'System.Data.SqlTypes.SqlDecimal' to type 'System.IConvertible' -

Calling GetGUIThreadInfo from Outlook VBA -

Obfuscating Python code? -