title: SQL Server, execute batch T-SQL script on multiple databases
body: <p>Our SQL Server 2000 instance hosts several databases which are all similar, one for each of our client. When comes the time to update them all, we use Red Gate SQL Compare to generate a migration script between the development database and a copy of the current state DB of all the clients database.</p>
  
  <p>SQL Compare generates a script which is transactional, if one step fails, the script rolls back everything. But currently our system uses a method that splits the script on batch separators (the <strong>GO statement</strong>) and then runs each command separately, which ruins all the transactional stuff. The <strong>GO</strong> statement is not supported when querying the database by programmation (in classic ASP)</p>
  
  <p>I want to know how I could run that script (keeping the transactions) on all those databases (like 250 DB), programmatically or manually in a tool? In <strong>Query Analyzer</strong>, we need to select each DB and press <strong>Run</strong> which is quite long for the number of DB we have.</p>