Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>The following works for me ( I am SQL Server 2008 though) : </p> <p>So the real answer I quess is to use <a href="http://www.commandline.co.uk/cmdow/" rel="nofollow noreferrer">cmdow</a></p> <p>Edit: After more testing I realized the following : First open the files with connenction with: ( remove any enters while copying, this is one liner )</p> <pre><code>"C:\Program Files\Microsoft SQL Server\100\Tools\Binn\VSShell\ Common7\IDE\Ssms.exe" "C:\Users\yordgeor\Desktop\Trigger.sql" "C:\Users\yordgeor\Desktop\Trigger1.sql" -S ysg -d poc_dev -E -nosplash </code></pre> <p>In this example it opens two files ( but you could open less of course ; ) after which , No matter how many times I run </p> <pre><code>cmdow /Run "C:\Users\yordgeor\Desktop\Trigger1.sql" cmdow /Run "C:\Users\yordgeor\Desktop\Trigger2.sql" cmdow /Run "C:\Users\yordgeor\Desktop\Trigger3.sql" </code></pre> <p>it opens the same instance of the Microsoft Sql Server Management Studio with the same connection </p> <p>you could open at once at the command line many files , but I quess you asked for the upper answer. </p> <p>So you could find the path to the Ssms.exe by: cd %ProgramFiles%</p> <p>dir *ssms.exe /s /b</p> <p>so the syntax of the command is: pathToTheExe pathToFile1 pathToFile2 -S serverName -d DatabaseToConnectTo -E (toUseWindowsAuthentication) -nosplash</p> <p>After 20 seconds of googling I cheated from <a href="http://www.mssqltips.com/tip.asp?tip=1602" rel="nofollow noreferrer">here</a>:</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload