title: SQL - Convert NULL to string.empty
body: <p>I'm trying to perform some upgrade maintenance on our database. I need to move 3 columns of data from all rows of one table and insert that data as new rows in a new table.</p>
  
  <pre><code>INSERT INTO [dbo].[SnmpSettings]([NetworkDiscoveryId], [RoCommunities], [RwCommunities])
      SELECT id, Ro_Community, RW_Communities
      FROM [dbo].[Network_Discovery] 
  </code></pre>
  
  <p>The above code would work fine, but Ro_Community and RW_Communities allow NULL where as RoCommunities and RwCommunities do not allow NULL. How should I convert NULLs to the empty string and then insert into my new table?</p>
  
  <p>EDIT:</p>
  
  <pre><code>INSERT INTO [dbo].[SnmpSettings]([NetworkDiscoveryId], [RoCommunities], [RwCommunities])
      SELECT id, Ro_Community, RW_Communities
      ISNULL(Ro_Community,'')
      FROM [dbo].[Network_Discovery] 
  
  
  Msg 102, Level 15, State 1, Line 27
  Incorrect syntax near 'Ro_Community'.
  </code></pre>