title: Isnull and data type in SQL Server
body: <p>Suppose I have a table like: </p>
  
  <pre><code>Tab(MyDate datetime null, MyIs bit null, ...)
  </code></pre>
  
  <p>Then I have SQL Like </p>
  
  <pre><code>    select Isnull(MyDate, 1), IsNull(MyIs, 999) from Tab;
  </code></pre>
  
  <p>If <code>MyDate</code>, <code>MyIs</code> value is <code>null</code> in DB, the result is:</p>
  
  <pre><code>    MyDate                   MyIs  
      1900-01-02 00:00:00.000  1
  </code></pre>
  
  <p>Not the expected value like     </p>
  
  <pre><code>MyDate        MyIs  
  1             999
  </code></pre>
  
  <p>So it looks like the return value is based on data type of the column.
  How to resolve this issue?</p>
  
  <p>For my testing case as above, I Only got one row from the table. </p>