-d database
-Q "query"
-i filename
-o filename
Simple examples for Cisco TMS use
Execute a script c:\update.sql against a local Cisco TMS SQL server install while logged in as a
Windows administrator
osql –E –S localhost\sqltms –d tmsng –i "c:\update.sql"
Run a query 'select username from acluser' against a local Cisco TMS SQL server install while
logged in as a Windows administrator and output results to c:\output.txt
osql –E –S localhost\sqltms –d tmsng –o c:\output.txt –Q "select username
from acluser"
Extra reference links
How to manage the SQL Server Desktop Engine (MSDE 2000) or SQL Server 2005 Express Edition by
using the osql utility
Cisco TMS Database Knowledge Tips
Specify the database to connect to. Equivalent to saying 'use
databasename'. For Cisco TMS operations, you will almost always specify
the tmsng database
Examples:
-d tmsng
Executes a query and immediately exits. Use double quotation marks
around the query and single quotation marks around anything embedded
in the query. Used to run a single command against the server.
Examples:
-Q "select * from
acluser"
Executes a SQL script from the specified filename. Useful when running a
batch of commands. Filenames that include spaces should be enclosed in
double quotation marks. To ease specifying filenames, files can be
dragged and dropped to the command window and the full path will
automatically be typed out
Examples:
-I "c:\update
scripts\test.sql"
Outputs result of command to a file rather than to the screen. Useful when
running large scripts or queries with lots of output.
Tips category – General
Connect to database named
tmsng
Runs the t-sql query select * from
acluser
Will execute the SQL code in the
file test.sql
Page 16 of 35
Need help?
Do you have a question about the TMS SQL DATABASE and is the answer not in the manual?
Questions and answers