title: Run same query in SSMS on multiple databases in the same server
body: <p>It is possible in SSMS to run the same query on some databases?
  I was thinking something like an array with database names and cycling through it, maybe with SQLCMD mode.</p>
  
  <p>some pseudocode:</p>
  
  <pre><code>:setvar arr ["db1", "db2", "db3"]
  foreach $db in $arr
      :setvar database $db
      use $(database)
      go
      select * from table
  </code></pre>
  
  <p>Thanks</p>