\documentclass[DIV=12,%
BCOR=0mm,%
headinclude=false,%
footinclude=false,open=any,%
fontsize=10pt,%
oneside,%
paper=210mm:11in]%
{scrbook}
\usepackage{microtype}
\usepackage{graphicx}
\usepackage{alltt}
\usepackage{verbatim}
\usepackage[shortlabels]{enumitem}
\usepackage{tabularx}
\usepackage[normalem]{ulem}
\def\hsout{\bgroup \ULdepth=-.55ex \ULset}
% https://tex.stackexchange.com/questions/22410/strikethrough-in-section-title
% Unclear if \protect \hsout is needed. Doesn't looks so
\DeclareRobustCommand{\sout}[1]{\texorpdfstring{\hsout{#1}}{#1}}
\usepackage{wrapfig}
% avoid breakage on multiple
and avoid the next [] to be eaten
\newcommand*{\forcelinebreak}{\strut\\*{}}
\newcommand*{\hairline}{%
\bigskip%
\noindent \hrulefill%
\bigskip%
}
% reverse indentation for biblio and play
\newenvironment*{amusebiblio}{
\leftskip=\parindent
\parindent=-\parindent
\smallskip
\indent
}{\smallskip}
\newenvironment*{amuseplay}{
\leftskip=\parindent
\parindent=-\parindent
\smallskip
\indent
}{\smallskip}
\newcommand*{\Slash}{\slash\hspace{0pt}}
% http://tex.stackexchange.com/questions/3033/forcing-linebreaks-in-url
\PassOptionsToPackage{hyphens}{url}\usepackage[hyperfootnotes=false,hidelinks,breaklinks=true]{hyperref}
\usepackage{bookmark}
\usepackage{fontspec}
\usepackage{polyglossia}
\setmainlanguage{english}
\setmainfont{cmunrm.otf}[Script=Latin,%
Path=/home/wiki/.fonts/cm-unicode/,%
BoldFont=cmunbx.otf,%
BoldItalicFont=cmunbi.otf,%
ItalicFont=cmunti.otf]
\setmonofont{cmuntt.otf}[Script=Latin,%
Scale=MatchLowercase,%
Path=/home/wiki/.fonts/cm-unicode/,%
BoldFont=cmuntb.otf,%
BoldItalicFont=cmuntx.otf,%
ItalicFont=cmunit.otf]
\setsansfont{cmunss.otf}[Script=Latin,%
Scale=MatchLowercase,%
Path=/home/wiki/.fonts/cm-unicode/,%
BoldFont=cmunsx.otf,%
BoldItalicFont=cmunso.otf,%
ItalicFont=cmunsi.otf]
\newfontfamily\englishfont{cmunrm.otf}[Script=Latin,%
Path=/home/wiki/.fonts/cm-unicode/,%
BoldFont=cmunbx.otf,%
BoldItalicFont=cmunbi.otf,%
ItalicFont=cmunti.otf]
% footnote handling
\usepackage[fragile]{bigfoot}
\usepackage{perpage}
\DeclareNewFootnote{default}
\renewcommand*{\partpagestyle}{empty}
% global style
\pagestyle{plain}
\usepackage{indentfirst}
% remove the numbering
\setcounter{secnumdepth}{-2}
% remove labels from the captions
\renewcommand*{\captionformat}{}
\renewcommand*{\figureformat}{}
\renewcommand*{\tableformat}{}
\KOMAoption{captions}{belowfigure,nooneline}
\addtokomafont{caption}{\centering}
\DeclareNewFootnote{B}
\MakeSorted{footnoteB}
\renewcommand*\thefootnoteB{(\arabic{footnoteB})}
\deffootnote[3em]{0em}{4em}{\textsuperscript{\thefootnotemark}~}
\addtokomafont{disposition}{\rmfamily}
\addtokomafont{descriptionlabel}{\rmfamily}
\frenchspacing
% avoid vertical glue
\raggedbottom
% this will generate overfull boxes, so we need to set a tolerance
% \pretolerance=1000
% pretolerance is what is accepted for a paragraph without
% hyphenation, so it makes sense to be strict here and let the user
% accept tweak the tolerance instead.
\tolerance=200
% Additional tolerance for bad paragraphs only
\setlength{\emergencystretch}{30pt}
% (try to) forbid widows/orphans
\clubpenalty=10000
\widowpenalty=10000
% given that we said footinclude=false, this should be safe
\setlength{\footskip}{2\baselineskip}
\title{FreeTDS}
\date{}
\author{Stefan Hornburg (Racke)}
\subtitle{Perl DBI and Microsoft SQL Server}
% https://groups.google.com/d/topic/comp.text.tex/6fYmcVMbSbQ/discussion
\hypersetup{%
pdfencoding=auto,
pdftitle={FreeTDS},%
pdfauthor={Stefan Hornburg (Racke)},%
pdfsubject={Perl DBI and Microsoft SQL Server},%
pdfkeywords={DBI; FreeTDS; ODBC; tsql}%
}
\begin{document}
\begin{titlepage}
\strut\vskip 2em
\begin{center}
{\usekomafont{title}{\huge FreeTDS\par}}%
\vskip 1em
{\usekomafont{subtitle}{Perl DBI and Microsoft SQL Server\par}}%
\vskip 2em
{\usekomafont{author}{Stefan Hornburg (Racke)\par}}%
\vskip 1.5em
\vfill
\strut\par
\end{center}
\end{titlepage}
\cleardoublepage
\tableofcontents
% start a new right-handed page
\cleardoublepage
\chapter{Testing setup with tsql}
Discover SQL server instances for server running on IP 10.10.6.6:
\begin{alltt}
tsql -H 10.10.6.6 -L
\end{alltt}
\chapter{TDS version}
Selecting the correct TDS version can be the key to success in connecting to Microsoft
SQL server.
For example with Microsoft SQL server version 10.50 and TDS version 7:
\begin{alltt}
Error 20017 (severity 9):
Unexpected EOF from the server
Error 20002 (severity 9):
Adaptive Server connection failed
There was a problem connecting to the server
\end{alltt}
With TDS version 8 it connected just fine.
\chapter{Date format}
For further processing ISO dates are helpful and automatically provided by MySQL and PostgreSQL.
If you get dates in a format like "Feb 28 2007 12:00AM", you change the format in \texttt{/etc/freetds/locales.conf} like that:
\begin{alltt}
[default]
date format = \%Y-\%m-\%d \%H:\%M:\%S
\end{alltt}
\chapter{Switch from ODBC with Microsoft driver to FreeTDS}
In this case you might see the following warning:
\begin{alltt}
Setting of CS\_OPT\_TEXTSIZE failed.
\end{alltt}
Reference: \href{https://metacpan.org/pod/DBD::Sybase\#Using-DBD::Sybase-with-MS-SQL}{https:\Slash{}\Slash{}metacpan.org\Slash{}pod\Slash{}DBD::Sybase\#Using-DBD::Sybase-with-MS-SQL}
% begin final page
\clearpage
% new page for the colophon
\thispagestyle{empty}
\begin{center}
Linuxia Wiki
\strut
\end{center}
\strut
\vfill
\begin{center}
Stefan Hornburg (Racke)
FreeTDS
Perl DBI and Microsoft SQL Server
\bigskip
\bigskip
\textbf{wiki.linuxia.de}
\end{center}
% end final page with colophon
\end{document}
% No format ID passed.