title: place dynamic query inside IF EXISTS conditions
body: <p>i tried to store the dynamic query inside IF EXISTS conditions in SQL Server</p>
  
  <pre><code>create procedure temp_order
  (
  @tbl varchar (max)
  )
  as
  begin
  IF EXISTS ('SELECT * FROM ' + @tbl + ' where cd = 1')
  end
  </code></pre>
  
  <p>but it looks like dynamic query wont work inside "IF EXISTS" condition, 
  any ways to make the condition if the tables is exist or not?</p>