Like the title says, in oracle you can issue the following command in SQL*Plus:
SQL> select something from anothertable; #sql
SQL> @{/home/me/somescript.sql}; #load sql from file and execute it
SQL> do something else in script; #other sql
Without having to file->open the sql script to load it to the UI.
Is there an equivalent in SQL Server Query Manager? I’ve stumbled upon many situation where i could have used it but i couldn’t be able to find a way to accomplish it.
If using latter versions of SQL Server (2005 & 2008), see if the
:rcommand in SQLCMD works for you::r <filename>
Parses additional Transact-SQL statements and sqlcmd commands from the file specified by <filename> into the statement cache.
If the file contains Transact-SQL statements that arenot followed by GO, you must enter GO on the line that follows :r.
From sqlcmd Utility