TSQL(1)
okay bestie, welcome to the tsql(1) manual page β yes, the FreeTDS diagnostic utility is here to vibe-check your TDS connections. π§β¨
πΈ NAME πΈ
tsql β utility to test FreeTDS connections and queries. literally that. π
π¦ SYNOPSIS π¦
tsql {-S servername [-I interface] | -H hostname [-L] [-p port]}
[-D dbname] [-U username] [-P password] [-o options]
tsql -C
β¨ DESCRIPTION β¨
okay so tsql is a FreeTDS diagnostic tool, and itβs giving protocol-testing main character energy. it uses the TDS protocol to connect to a Sybase or Microsoft SQL Server, and it lets the user issue queries. lowkey iconic. π«Ά
the thing to know: tsql does not use the FreeTDS client libraries. instead, it uses only the lowest level library, libtds, to test the protocol implementation. thatβs the whole point, bestie.
you can run tsql in two ways: one uses freetds.conf, and one 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. no cap. π¦
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. slay. β¨
π OPTIONS π
one bullet per flag, all facts intact, no skips:
-S servernameβ database server to which to connect. π-D dbnameβ database to use.-I interfaceβfreetds.confor interfaces file describingservername.-H hostnameβ DNS hostname of the server.-p portβ port at which SQL Server is listening.-U usernameβ database login name. ifusernameis not provided, a domain login is attempted for TDS 7+ connections.-P passwordβ database password.-Lβ list Microsoft server instances (with-H).-Cβ print some of the compile-time configuration parameters.-o optionsβ apply the options specified to every command.-fβ no footer[result count].-hβ no header[titles].-tβ print time.-vβ print version.-qβ quiet.
-a appnameβ application name.-t coltermβ column terminator.-r rowtermβ row terminator.-r rowtermβ row terminator. (the original really lists it twice, so weβre keeping the duplicate, bestie π«Ά)-J charsetβ character set.-vβ verbose mode.
π NOTES π
- if you can connect with
tsql -S servername, your basic FreeTDS installation is working. periodt. π - typing
exit,quit, orbye(or^D) exitstsql. bye bestie π - typing
versiondisplays the TDS protocol version. - command batches may be separated with
goorGO. if you useGO, the version string is reported before executing the batch. - after prompting for the password (if not provided with
-P),tsqlwill attempt to connect to the remote server.tsqldisplays a counter indicating the number of seconds elapsed during the connection attempt. typically,tsqlimmediately responds with a1>prompt. if you see the counter (1,2,3, ...), most likelytsqlis unable to connect to the indicated server. π tsqlis not a replacement for a complete isql such assqsh(www.sqsh.org). if you have suggestions for ways to maketsqlmore useful as a diagnostic tool, please post them to the FreeTDS mailing list for consideration. π
π HISTORY π
tsql first appeared in FreeTDS 0.60. a whole era. β¨
π AUTHORS π
the tsql utility was written by Brian Bruns. king behavior π
π¦ BUGS π¦
Several, to be sure, now that itβs documented. :) β yes, thatβs the actual bug report energy. π
thatβs it, bestie β source/version: FreeTDS 1.5.20, date: March 25, 2015, manual footer tag: TSQL(FreeTDS). π«Άπ β¨
π¦ where this page comes from
- arch rolling: freetds 1.5.20-1 Β· GPL-2.0-only AND LGPL-2.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms