title: Replace Null with "absent" in SQL Server in result after procedure execute statement
body: <p>I want to replace <code>null</code> with <code>absent</code> when statement is executed in stored procedure</p>
  
  <p>This is the stored procedure:</p>
  
  <pre><code>create proc attendance
  (
   @year varchar(100) = null  , 
   @month varchar(100) =null  , 
   @centerId   varchar(100)     =  null
  )
  as
  begin
     declare @day  int
     set @day = 2
  
     declare @days varchar(8000)
     set @days = '[1]'
  
     WHILE (@day &lt;= 31)
     BEGIN
         set @days = @days + ',[' + convert(varchar, @day) + ']'
         set @day  = @day + 1
         --print @days   
     END
     --print @day 
  
     DECLARE @query varchar(8000)  //** Here If the condition don't match it gives NULL but I want to print absent instead of NULL **//
     set @query = 'SELECT TB05001,' + @days  + 'from 
       (SELECT TB05001, TB05003, day(TB05002) as day FROM TB05, tb04 
             Where  tb04023 =' + @centerId + ' and  year(TB05002)=' + @year + '  and month(TB05002) =' + @month + 'and tb04003=tb05001            
           ) AS SourceTable 
  
         pivot ( 
              MAX(TB05003)
                 for day in (' + @days +')
               )p'
  
   print('pivoted report')    
  exec(@query)
  end
  </code></pre>
  
  <p>When I enter the data</p>
  
  <pre><code>exec attendance '2013', '11', '1004'
  </code></pre>
  
  <p>This is the return output and I want to replace null with absent</p>
  
  <p><img src="https://i.stack.imgur.com/XzB0o.jpg" alt="enter image description here"></p>