title: How to replace NULL with empty string in SQL?
body: <p>I am using below query to fetch column value by comma separated.</p>
  
  <pre><code>    (SELECT STUFF ((SELECT  ',' + CAST(Proj_ID AS VARCHAR) FROM PROJECT
      left join dbo.PROJ_STA on
      Project.PROJ_STA_ID = Project.PROJ_STA_ID
      WHERE ENTER_DT &lt; DATEADD(Year, -7, GETDATE())  AND PROJ_LFCYC_STA_CD = 'A' AND 
      PROJ_STA.PROJ_STA_DS = 'Cancelled' FOR XML PATH('')), 1, 1, '') 
      AS Enter_Date)  
  </code></pre>
  
  <p>Can anyone guide me to replace null value by empty string here.</p>
  
  <p>Updated:</p>
  
  <pre><code>    (SELECT STUFF ((SELECT  ',' + coalesce( CAST(Proj_ID AS VARCHAR), '' ) FROM PROJECT
      left join dbo.PROJ_STA on
      Project.PROJ_STA_ID = Project.PROJ_STA_ID
      WHERE ENTER_DT &lt; DATEADD(Year, -7, GETDATE())  AND PROJ_LFCYC_STA_CD = 'A' AND 
      PROJ_STA.PROJ_STA_DS = 'Cancelled' FOR XML PATH('')), 1, 1, '') 
      AS Enter_Date)  
  </code></pre>