The isqlw utility (SQL Server Query Analyzer) allows you to enter Transact-SQL statements, system stored procedures, and script files. You can set up shortcuts or create batch files to launch a preconfigured SQL Server Query Analyzer.
isqlw [[-?][-S server][-d database][-E][-U user] [-P password]
{[-i input_file][-o output_file]}[-F U | A | O]
[-s “column_separator”][-f file_list]]
The isqlw utility is started directly from the operating system with the case-sensitive options listed here. After starting, SQL Server Query Analyzer accepts SQL statements and sends them to SQL Server interactively. The results are formatted and displayed on the screen. Use the File/Exit menu option or Alt+F4 to exit from isqlw.
If no arguments are specified, isqlw starts SQL Server Query Analyzer and interactively takes the input (server, login, and password). If no valid connection properties are specified (for example, if no trusted connection is specified and the login name is also missing), the normal connection dialog box for SQL Server Query Analyzer appears.
SQL Server Query Analyzer uses the ODBC API. The utility uses the Microsoft SQL Server ODBC driver default settings for SQL-92, except for QUOTED_IDENTIFIER. SQL Server Query Analyzer defaults to setting QUOTED_IDENTIFIER OFF. To set the option on, go to the Query\Current Connection Options menu and select Use ANSI quoted identifiers in the General tab. For more information, see Effects of SQL-92 Options.
To use isqlw interactively, enter the isqlw command (and any of the options) at a command prompt.
A. Executing SQL statements
This example connects to MyServer (pubs database) and executes SQL statements from input_file and stores the results of the execution in output_file.
isqlw -S MyServer -d pubs -U sa -P -i input_file -o output_file
B. Using wildcards
This example loads all .sql files into SQL Server Query Analyzer. All connections use Windows NT Authentication and point to the pubs database on the local server.
isqlw -d pubs -E -f c:\mssql7\install\*.sql
C. Loading multiple files
This example loads two files into SQL Server Query Analyzer. It uses Windows NT Authentication to connect to the local server.
isqlw -d pubs -E -f c:\mssql7\install\instpubs.sql c:\mssql7\install\instcat.sql
D. Using Unicode files
This example connects to the pubs database on MyServer using Windows NT Authentication and executes the Input.sql file. The results are saved in the Output.txt file. The files are opened as Unicode files.
isqlw -S MyServer -d pubs -E -i input.sql -o output.txt -FU