To simplify the use of large queries and for those who store their queries in a file, enter the following query where <filename> is the fully qualified name of a file containing the query to execute.
For example, RUN c:\temp\myquery.sql
The Run statement must be the only statement in the Query window. A filename can be followed by a semicolon. All text between the word RUN and the optional semicolon are assumed to be a part of the file name.
The query is processed exactly as though it had been entered in the Query window, but the SQL stored in the history file is the run statement itself, not the actual query that was executed.