.\"Text automatically generated by txt2man .TH bsqldb 1 "13 November 2011" "doc" "FreeTDS Utilities" .SH NAME \fBbsqldb \fP- batch SQL script processor using DB-Library \fB .SH SYNOPSIS .nf .fam C \fBbsqldb\fP [\fB-U\fP \fIusername\fP] [\fB-P\fP \fIpassword\fP] [\fB-S\fP \fIservername\fP] [\fB-D\fP \fIdatabase\fP] [\fB-i\fP \fIinput_file\fP] [\fB-o\fP \fIoutput_file\fP] [\fB-e\fP \fIerror_file\fP] [\fB-H\fP \fIhostname\fP] [\fB-t\fP \fIfield_term\fP] [\fB-hqv\fP] .fam T .fi .fam T .fi .SH DESCRIPTION \fBbsqldb\fP is a utility program distributed with FreeTDS. .PP \fBbsqldb\fP is a non-interactive equivalent of the "isql" utility programs distributed by Sybase and Microsoft. Like them, \fBbsqldb\fP uses the command "go" on a line by itself as a separator between batches. The last batch need not be followed by "go". .PP \fBbsqldb\fP makes use of the DB-Library API provided by FreeTDS. This API is of course also available to application developers. .SH OPTIONS .TP .B \fB-U\fP \fIusername\fP Database server login name. If \fIusername\fP is not provided, a domain login is attempted for TDS 7+ connections. .TP .B \fB-P\fP \fIpassword\fP Database server \fIpassword\fP. .PP \fB-S\fP \fIservername\fP Database server to which to connect. .TP .B \fB-D\fP \fIdatabase\fP Database to use. .TP .B \fB-i\fP \fIinput_file\fP Name of script file, containing SQL. .TP .B \fB-o\fP \fIoutput_file\fP Name of output file, holding result data. .TP .B \fB-e\fP \fIerror_file\fP Name of file for errors. .TP .B \fB-t\fP \fIfield_term\fP Specifies the field terminator. Default is two spaces (' '). Recognized escape sequences are tab ('\\t'), carriage return ('\\r'), newline ('\\n'), and backslash ('\\\\'). .TP .B \fB-h\fP Print column headers with the data to the same file. .TP .B \fB-H\fP \fIhostname\fP Override name of client sent to server. .TP .B \fB-q\fP Do not print column metadata, return status, or rowcount. Overrides \fB-h\fP. .TP .B \fB-v\fP Verbose mode, for more information about the DB-Libraryrary interaction. This also reports the result set metadata, including and return code. All verbose data are written to standard error (or \fB-e\fP), so as not to interfere with the data stream. .SH ENVIRONMENT .TP .B DSQUERY default \fIservername\fP .SH NOTES \fBbsqldb\fP is a filter; it reads from standard input, writes to standard output, and writes errors to standard error. The \fB-i\fP, \fB-o\fP, and \fB-e\fP options override these, of course. .PP The source code for \fBbsqldb\fP is intended as a model for DB-Library users. DB-Library has a rich set of functions, and it can be hard sometimes to understand how to use them, particularly the first time. If you are using it in this way and find something unclear, you are encouraged to email the author your comments. .SH EXIT STATUS \fBbsqldb\fP exits 0 on success, and >0 if the server cannot process the query. .PP \fBbsqldb\fP will report any errors returned by the server, but will continue processing. In a production environment, this behavior may be insufficiently stringent. To make it extremely intolerant of errors, change the message and error handlers to call \fBexit\fP(3). .SH HISTORY \fBbsqldb\fP first appeared in FreeTDS 0\.63. .SH AUTHORS The \fBbsqldb\fP utility was written by James K. Lowden .SH BUGS Microsoft servers as of SQL Server 7.0 SP 3 do not return output parameters unless the RPC functions are used. This means \fBbsqldb\fP cannot return output parameters for stored procedures with these servers.