title: How to create trigger inside an IF condition?
body: <p>I'm trying to create a trigger on a table. My requirement is to create trigger only when the table exists.</p>
  
  <p>e.g. </p>
  
  <pre><code>if(table exists)
          begin
               create trigger on the table 
          end 
  </code></pre>
  
  <p>After googling, I found that <code>create trigger</code> should be first command in the batch. 
  That means I can not use the <code>if</code> or any other thing in the current batch.</p>
  
  <p>Please, help me out! </p>