1TSQL(FreeTDS)              FreeTDS Reference Manual              TSQL(FreeTDS)
2

NAME

4     tsql — utility to test FreeTDS connections and queries
5

SYNOPSIS

7     tsql {-S servername [-I interface] | -H hostname [-L] [-p port]}
8          [-D dbname] [-U username] [-P password] [-o options]
9     tsql -C
10

DESCRIPTION

12     tsql is a FreeTDS diagnostic tool. It uses the TDS protocol to connect to
13     a Sybase or Microsoft SQL Server, and lets the user issue queries.  tsql
14     does not use the FreeTDS client libraries. Instead, it uses only the low‐
15     est level library, libtds, to test the protocol implementation.
16
17     tsql can be run in two ways, one which uses the freetds.conf and one
18     which connects directly using the server's hostname and port.  The -H and
19     -p parameters are provided to let the user verify a server is listening
20     on the named host and port. These parameters override any configuration
21     files and environment variables.  The -S parameter can be used to test
22     the local configuration. FreeTDS will use freetds.conf (or equivalent)
23     and environment variables in the normal way to determine the server's IP
24     address and port. You can use -I to specify a filename, overriding
25     FreeTDS's configuration file search algorithm.
26

OPTIONS

28     -S servername
29             database server to which to connect.
30
31     -D dbname
32             database to use.
33
34     -I interface
35             freetds.conf or interfaces file describing servername.
36
37     -H hostname
38             DNS hostname of the server.
39
40     -p port
41             port at which SQL Server is listening.
42
43     -U username
44             database login name. If username is not provided, a domain login
45             is attempted for TDS 7+ connections.
46
47     -P password
48             database password.
49
50     -L      list Microsoft server instances (with -H).
51
52     -C      print some of the compile-time configuration parameters.
53
54     -o options
55             apply the options specified to every command.
56
57             -f      No footer [result count]
58
59             -h      No header [titles]
60
61             -t      Print time
62
63             -v      Print version
64
65             -q      Quiet
66
67     -a appname
68             application name.
69
70     -t colterm
71             column terminator.
72
73     -r rowterm
74             row terminator.
75
76     -r rowterm
77             row terminator.
78
79     -J charset
80             character set.
81
82     -v      verbose mode.
83

NOTES

85     If you can connect with ‘tsql -S servername’, your basic FreeTDS instal‐
86     lation is working.
87
88     Typing ‘exit’, ‘quit’, or ‘bye’ (or ^D) exits tsql.
89
90     Typing ‘version’ displays the TDS protocol version.
91
92     Command batches may be separated with ‘go’ or ‘GO’.  If ‘GO’ the version
93     string is reported before executing the batch.
94
95     After prompting for the password (if not provided with -P), tsql will
96     attempt to connect to the remote server.  tsql displays a counter indi‐
97     cating the number of seconds elapsed during the connection attempt. Typi‐
98     cally, tsql immediately responds with a ‘1>’ prompt. If you see the
99     counter (1, 2, 3, ...), most likely tsql is unable to connect to the
100     indicated server.
101
102     tsql is not a replacement for a complete isql such as sqsh
103     (www.sqsh.org).  If you have suggestions for ways to make tsql more use‐
104     ful as a diagnostic tool, please post them to the FreeTDS mailing list
105     for consideration.
106

HISTORY

108     tsql first appeared in FreeTDS 0.60.
109

AUTHORS

111     The tsql utility was written by Brian Bruns.
112

BUGS

114     Several, to be sure, now that it's documented. :)
115
116FreeTDS 1.00.38                 March 25, 2015                 FreeTDS 1.00.38
Impressum