title: isnull for dynamically Generated column
body: <p>I am getting temp table with dynamically generated columns let say it is columns <code>A,B,C,D</code> etc from other source.</p>
  
  <p>Now in my hand I have temp table with column generated. I had to write stored procedure with the use of temp table.</p>
  
  <p>So my stored procedure is like </p>
  
  <pre><code>create proc someproc() 
  as 
  begin 
  Insert into #searchtable 
  select isnull(#temp.*,0.00) 
  End
  </code></pre>
  
  <p>Now <code>#searchresult</code> is table created by me to store temp table columns. The problem arises when I want to check <code>isnull</code> for <code>#tempdb</code> columns. Because from source it comes it may be 3 columns, again next time it may be 4 columns. It changes.</p>
  
  <p>Since it is dynamically generated I cannot use each column name and use like below:</p>
  
  <pre><code>isnull(column1,0.00)
  isnull(column2,0.00)
  </code></pre>
  
  <p>I had to use all column generated and check if value is empty use <code>0.00</code></p>
  
  <p>I tried this below but not working:</p>
  
  <pre><code>  isnull(##temp.*,0.00),  
  </code></pre>