title: cursor with if statement
body: <p>How can i write cursor when table is not fix.
  E.g</p>
  
  <pre><code>DECLARE cursor_1 CURSOR
  FOR 
   IF BEGIN @i=1 SELECT col1,col2 FROM table_1 END
   ELSE BEGIN SELECT col1,col2 FROM table_2 END
  </code></pre>
  
  <p>...</p>
  
  <p>This gives syntax error please suggest ?</p>