tsql — utility to test FreeTDS connections and queries
Contents
Bugs
Several, to be sure, now that it's documented. :)
FreeTDS 1.3.17 March 25, 2015 TSQL(FreeTDS)
Description
tsql is a FreeTDS diagnostic tool. It uses the TDS protocol to connect to a Sybase or Microsoft SQL
Server, and lets the user issue queries. tsql does not use the FreeTDS client libraries. Instead, it
uses only the lowest level library, libtds, to test the protocol implementation.
tsql can be run in two ways, one which uses the freetds.conf and one which connects directly using the
server's hostname and port. The -H and -p parameters are provided to let the user verify a server is
listening on the named host and port. These parameters override any configuration files and environment
variables. The -S parameter can be used to test the local configuration. FreeTDS will use freetds.conf
(or equivalent) and environment variables in the normal way to determine the server's IP address and
port. You can use -I to specify a filename, overriding FreeTDS's configuration file search algorithm.
History
tsql first appeared in FreeTDS 0.60.
Name
tsql — utility to test FreeTDS connections and queries
Notes
If you can connect with ‘tsql -S servername’, your basic FreeTDS installation is working.
Typing ‘exit’, ‘quit’, or ‘bye’ (or ^D) exits tsql.
Typing ‘version’ displays the TDS protocol version.
Command batches may be separated with ‘go’ or ‘GO’. If ‘GO’ the version string is reported before
executing the batch.
After prompting for the password (if not provided with -P), tsql will attempt to connect to the remote
server. tsql displays a counter indicating the number of seconds elapsed during the connection attempt.
Typically, tsql immediately responds with a ‘1>’ prompt. If you see the counter (1, 2, 3, ...), most
likely tsql is unable to connect to the indicated server.
tsql is not a replacement for a complete isql such as sqsh (www.sqsh.org). If you have suggestions for
ways to make tsql more useful as a diagnostic tool, please post them to the FreeTDS mailing list for
consideration.
Options
-Sservername
database server to which to connect.
-Ddbname
database to use.
-Iinterface
freetds.conf or interfaces file describing servername.
-Hhostname
DNS hostname of the server.
-pport
port at which SQL Server is listening.
-Uusername
database login name. If username is not provided, a domain login is attempted for TDS 7+
connections.
-Ppassword
database password.
-L list Microsoft server instances (with -H).
-C print some of the compile-time configuration parameters.
-ooptions
apply the options specified to every command.
-f No footer [result count]
-h No header [titles]
-t Print time
-v Print version
-q Quiet
-aappname
application name.
-tcolterm
column terminator.
-rrowterm
row terminator.
-rrowterm
row terminator.
-Jcharset
character set.
-v verbose mode.
Synopsis
tsql {-Sservername [-Iinterface] | -Hhostname [-L] [-pport]} [-Ddbname] [-Uusername] [-Ppassword]
[-ooptions]
tsql-C