.\" Automatically generated by Pod::Man 4.09 (Pod::Simple 3.35) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .if !\nF .nr F 0 .if \nF>0 \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} .\} .\" ======================================================================== .\" .IX Title "DBIx::Class::Storage::DBI::ODBC::Microsoft_SQL_Server 3pm" .TH DBIx::Class::Storage::DBI::ODBC::Microsoft_SQL_Server 3pm "2018-04-19" "perl v5.26.2" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" DBIx::Class::Storage::DBI::ODBC::Microsoft_SQL_Server \- Support specific to Microsoft SQL Server over ODBC .SH "DESCRIPTION" .IX Header "DESCRIPTION" This class implements support specific to Microsoft \s-1SQL\s0 Server over \s-1ODBC.\s0 It is loaded automatically by DBIx::Class::Storage::DBI::ODBC when it detects a \&\s-1MSSQL\s0 back-end. .PP Most of the functionality is provided from the superclass DBIx::Class::Storage::DBI::MSSQL. .SH "USAGE NOTES" .IX Header "USAGE NOTES" .SS "Basic Linux Setup (Debian)" .IX Subsection "Basic Linux Setup (Debian)" .Vb 1 \& sudo aptitude install tdsodbc libdbd\-odbc\-perl unixodbc .Ve .PP In case it is not already there put the following (adjust for non\-64bit arch) in \&\f(CW\*(C`/etc/odbcinst.ini\*(C'\fR: .PP .Vb 5 \& [FreeTDS] \& Description = FreeTDS \& Driver = /usr/lib/x86_64\-linux\-gnu/odbc/libtdsodbc.so \& Setup = /usr/lib/x86_64\-linux\-gnu/odbc/libtdsS.so \& UsageCount = 1 .Ve .PP Set your \f(CW$dsn\fR in connect_info as follows: .PP .Vb 1 \& dbi:ODBC:server=;port=1433;driver=FreeTDS;tds_version=8.0 .Ve .PP If you use the EasySoft driver (): .PP .Vb 1 \& dbi:ODBC:server=;port=1433;driver=Easysoft ODBC\-SQL Server .Ve .SS "Basic Windows Setup" .IX Subsection "Basic Windows Setup" Use the following \f(CW$dsn\fR for the Microsoft \s-1ODBC\s0 driver: .PP .Vb 1 \& dbi:ODBC:driver={SQL Server};server=SERVER\eSQL_SERVER_INSTANCE_NAME .Ve .PP And for the Native Client: .PP .Vb 1 \& dbi:ODBC:driver={SQL Server Native Client 10.0};server=SERVER\eSQL_SERVER_INSTANCE_NAME .Ve .PP Go into Control Panel \-> System and Security \-> Administrative Tools \-> Data Sources (\s-1ODBC\s0) to check driver names and to set up data sources. .PP Use System DSNs, not User DSNs if you want to use DSNs. .PP If you set up a \s-1DSN,\s0 use the following \f(CW$dsn\fR for connect_info: .PP .Vb 1 \& dbi:ODBC:dsn=MY_DSN .Ve .SH "MULTIPLE ACTIVE STATEMENTS" .IX Header "MULTIPLE ACTIVE STATEMENTS" The following options are alternative ways to enable concurrent executing statement support. Each has its own advantages and drawbacks and works on different platforms. Read each section carefully. .PP For more details about using \s-1MAS\s0 in \s-1MSSQL\s0 over \s-1DBD::ODBC\s0 see this excellent document provided by EasySoft: . .PP In order of preference, they are: .IP "\(bu" 8 mars .IP "\(bu" 8 dynamic_cursors .IP "\(bu" 8 server_cursors .SH "METHODS" .IX Header "METHODS" .SS "connect_call_use_mars" .IX Subsection "connect_call_use_mars" Use as: .PP .Vb 1 \& on_connect_call => \*(Aquse_mars\*(Aq .Ve .PP in your connection info, or alternatively specify it directly: .PP .Vb 6 \& Your::Schema\->connect ( \& $original_dsn . \*(Aq; MARS_Connection=Yes\*(Aq, \& $user, \& $pass, \& \e%attrs, \& ) .Ve .PP Use to enable a feature of \s-1SQL\s0 Server 2005 and later, \*(L"Multiple Active Result Sets\*(R". See \*(L"Does \s-1DBD::ODBC\s0 support Multiple Active Statements?\*(R" in \s-1DBD::ODBC::FAQ\s0 for more information. .PP This does not work on FreeTDS drivers at the time of this writing, and only works with the Native Client, later versions of the Windows \s-1MS ODBC\s0 driver, and the Easysoft driver. .SS "connect_call_use_dynamic_cursors" .IX Subsection "connect_call_use_dynamic_cursors" Use as: .PP .Vb 1 \& on_connect_call => \*(Aquse_dynamic_cursors\*(Aq .Ve .PP Which will add \f(CW\*(C`odbc_cursortype => 2\*(C'\fR to your \s-1DBI\s0 connection attributes, or alternatively specify the necessary flag directly: .PP .Vb 1 \& Your::Schema\->connect (@dsn, { ... odbc_cursortype => 2 }) .Ve .PP See \*(L"odbc_cursortype\*(R" in \s-1DBD::ODBC\s0 for more information. .PP If you're using FreeTDS, \f(CW\*(C`tds_version\*(C'\fR must be set to at least \f(CW8.0\fR. .PP This will not work with \s-1CODE\s0 ref connect_info's. .PP \&\fB\s-1WARNING:\s0\fR on FreeTDS (and maybe some other drivers) this will break \&\f(CW\*(C`SCOPE_IDENTITY()\*(C'\fR, and \f(CW\*(C`SELECT @@IDENTITY\*(C'\fR will be used instead, which on \s-1SQL\s0 Server 2005 and later will return erroneous results on tables which have an on insert trigger that inserts into another table with an \f(CW\*(C`IDENTITY\*(C'\fR column. .PP \&\fB\s-1WARNING:\s0\fR on FreeTDS, changes made in one statement (e.g. an insert) may not be visible from a following statement (e.g. a select.) .PP \&\fB\s-1WARNING:\s0\fR FreeTDS versions > 0.82 seem to have completely broken the \s-1ODBC\s0 protocol. \s-1DBIC\s0 will not allow dynamic cursor support with such versions to protect your data. Please hassle the authors of FreeTDS to act on the bugs that make their driver not overly usable with \s-1DBD::ODBC.\s0 .SS "connect_call_use_server_cursors" .IX Subsection "connect_call_use_server_cursors" Use as: .PP .Vb 1 \& on_connect_call => \*(Aquse_server_cursors\*(Aq .Ve .PP May allow multiple active select statements. See \&\*(L"odbc_SQL_ROWSET_SIZE\*(R" in \s-1DBD::ODBC\s0 for more information. .PP Takes an optional parameter for the value to set the attribute to, default is \&\f(CW2\fR. .PP \&\fB\s-1WARNING\s0\fR: this does not work on all versions of \s-1SQL\s0 Server, and may lock up your database! .PP At the time of writing, this option only works on Microsoft's Windows drivers, later versions of the \s-1ODBC\s0 driver and the Native Client driver. .SH "FURTHER QUESTIONS?" .IX Header "FURTHER QUESTIONS?" Check the list of additional \s-1DBIC\s0 resources. .SH "COPYRIGHT AND LICENSE" .IX Header "COPYRIGHT AND LICENSE" This module is free software copyright by the DBIx::Class (\s-1DBIC\s0) authors. You can redistribute it and/or modify it under the same terms as the DBIx::Class library.