title: Execute Dynamic Query with go in sql
body: <pre><code>DECLARE @script VARCHAR(MAX);
  SET @script = 
      '
      create table ali(id decimal(10,0));
      drop table ali;
      go
      create table ali(id decimal(10,0));
      drop table ali;
      '
  
  EXEC (@script);
  </code></pre>
  
  <p>Error message occured when execute above query. Please tell me if you have an idea for resolve this.</p>
  
  <blockquote>
    <p>Msg 102, Level 15, State 1, Line 4 Incorrect syntax near 'go'.</p>
  </blockquote>
  
  <p><strong>Note : the above code for create and drop created table is just for example, 
  i have some other dynamic queries with go statement. Please do not give this answer.</strong></p>
  
  <pre><code>DECLARE @script   VARCHAR(MAX),
          @script1  VARCHAR(MAX);
  SET @script = 
      '
      create table ali(id decimal(10,0));
      drop table ali;
      ';
  SET @script1 = 
      '
      create table ali(id decimal(10,0));
      drop table ali;
      ';
  EXEC (@script);
  EXEC (@script1);
  </code></pre>