title: SQL Server not allowing NULL for Date even though mentioned as null while creation
body: <p>I am trying to create a table for library management system and i want my date_in to be null for some cases. When I am trying to give null it is giving me error as:</p>
  
  <blockquote>
    <p>Msg 4864, Level 16, State 1, Line 7<br>
    Bulk load data conversion error (type mismatch or invalid character for the specified codepage) for row 8, column 7 (date_in).</p>
    
    <p>Msg 4864, Level 16, State 1, Line 7<br>
    Bulk load data conversion error (type mismatch or invalid character for the specified codepage) for row 9, column 7 (date_in).</p>
    
    <p>Msg 4864, Level 16, State 1, Line 7<br>
    Bulk load data conversion error (type mismatch or invalid character for the specified codepage) for row 10, column 7 (date_in).</p>
    
    <p>Msg 4864, Level 16, State 1, Line 7 
    Bulk load data conversion error (type mismatch or invalid character for the specified codepage) for row 11, column 7 (date_in).</p>
    
    <p>Msg 4864, Level 16, State 1, Line 7<br>
    Bulk load data conversion error (type mismatch or invalid character for the specified codepage) for row 12, column 7 (date_in).</p>
    
    <p>Msg 4864, Level 16, State 1, Line 7<br>
    Bulk load data conversion error (type mismatch or invalid character for the specified codepage) for row 13, column 7 (date_in).</p>
  </blockquote>
  
  <p>I have explicitly mentioned that attribute to take null but still it is not allowing.
  help me</p>
  
  <p>thanks in advance</p>
  
  <p>Here is the query:</p>
  
  <pre><code>create table book_loans
  (
       loan_id varchar(10) not null,
       book_id varchar(10) not null,
       branch_id smallint not null,
       card_no varchar(10) not null,
       date_out date null default null,
       due_date date null default null,
       date_in date null default null
  )
  
  BULK
  INSERT book_loans
  FROM 'F:\sql project\resources\SQL_library_project_data\book_loans_data.txt'
  WITH
  (
  FIELDTERMINATOR = ',',
  ROWTERMINATOR = '&lt;&gt;',
  FIRSTROW=2
  )
  GO
  </code></pre>
  
  <p>here is the data file:</p>
  
  <pre><code>load_id,book_id,branch_id,card_no,date_out,due_date,date_in&lt;&gt;
  1,0399147020,1,9019,2013-11-22,2013-12-06,2013-12-01&lt;&gt;
  2,0030059380,4,9007,2013-12-01,2013-12-15,2013-12-16&lt;&gt;
  3,0671880756,5,9018,2013-12-08,2013-12-22,2013-12-22&lt;&gt;
  4,0911625291,3,9013,2014-01-02,2014-01-16,2014-01-12&lt;&gt;
  5,0688161995,5,9022,2014-02-10,2014-02-24,2014-03-01&lt;&gt;
  6,0911625291,2,9011,2014-03-03,2014-03-17,2014-03-16&lt;&gt;
  7,1861003730,3,9034,2014-04-17,2014-05-01,NULL&lt;&gt;
  8,0201612585,3,9034,2014-04-17,2014-05-01,NULL&lt;&gt;
  9,1565927699,3,9034,2014-04-17,2014-05-01,NULL&lt;&gt;
  10,0192860925,4,9009,2014-04-18,2014-05-02,NULL&lt;&gt;
  11,0805057579,1,9021,2014-04-18,2014-05-02,NULL&lt;&gt;
  12,0911625607,2,9018,2014-04-19,2014-05-03,NULL
  </code></pre>