Using the osql Utility Topic last updated -- January 2004 The
osql utility is a Microsoft® Win32® command prompt utility for
ad hoc, interactive execution of Transact-SQL statements and
scripts. The osql utility is typically used in these ways: -
Users interactively enter Transact-SQL statements in a manner
similar to working on the command prompt. The results are
displayed in the command prompt window. - Users submit an osql
job either specifying a single Transact-SQL statement to execute
or pointing the utility to a text file that contains Transact-
SQL statements to execute. The output is usually directed to a
text file, but it also can be displayed in the command prompt
window. To use osql interactively or to build script files to be
run using osql, users must understand Transact-SQL. The
following sections of SQL Server Books Online document building
Transact-SQL statements: |Accessing and Changing Relational Data
Overview||Documents how to build Transact-SQL statements from
individual syntax elements and