DBIx::C..._Server(3)
πΈ NAME πΈ
Okay bestie, the star of this page is DBIx::Class::Storage::DBI::ADO::Microsoft_SQL_Server β yes, that whole long icon of a name β and it's literally support for Microsoft SQL Server via DBD::ADO. We're in the User Contributed Perl Documentation section, and this page has main character energy for MSSQL-over-ADO. π
β¨ SYNOPSIS β¨
This subclass supports MSSQL server connections via DBD::ADO. That's the whole synopsis, short and iconic. π«Ά
π DESCRIPTION π
The MSSQL specific functionality is provided by DBIx::Class::Storage::DBI::MSSQL. So this page is the ADO-flavored wrapper, and the MSSQL details live over there. No cap.
π EXAMPLE DSN π
Here's the example DSN, exactly as given:
dbi:ADO:provider=sqlncli10;server=EEEBOX\SQLEXPRESS
Use it as the reference, not me inventing a new one. π¦
π CAVEATS π
Okay, caveat time, bestie. These are the things you need to know so your MSSQL ADO situation doesn't jump scare you. π
πͺͺ identities
_identity_method is set to @@identity, because SCOPE_IDENTITY() doesn't work with DBD::ADO. See "IMPLEMENTATION NOTES" in DBIx::Class::Storage::DBI::MSSQL for the caveats regarding this. That's important β don't @ me. π
π©Ή truncation bug
There is a bug with MSSQL ADO providers where data gets truncated based on the size of the bind sizes in the first prepare call:
https://rt.cpan.org/Ticket/Display.html?id=52048
The ado_size workaround is used (see "ADO providers" in DBD::ADO) with the approximate maximum size of the data_type of the bound column, or 8000 (maximum VARCHAR size) if the data_type is not available.
Please report problems with this driver and send patches. For real, patches are welcome. π«Ά
π LongReadLen
LongReadLen is set to LongReadLen * 2 + 1 on connection as it is necessary for some LOB types. Be aware of this if you localize this value on the $dbh directly. That's the heads-up, bestie. β
𧬠binary data
Due perhaps to the ado_size workaround we use, and/or other reasons, binary data such as varbinary column data comes back padded with trailing NULL chars. The Cursor class for this driver (DBIx::Class::Storage::DBI::ADO::Microsoft_SQL_Server::Cursor) removes them, of course if your binary data is actually NULL padded that may be an issue to keep in mind when using this driver. So the Cursor is doing cleanup, but if actual NULL padding is part of your data, keep that in mind. π
π uniqueidentifier columns
uniqueidentifier columns come back from ADO wrapped in braces and must be submitted to the MSSQL ADO driver wrapped in braces. We take care of this transparently in this driver and the associated Cursor class (DBIx::Class::Storage::DBI::ADO::Microsoft_SQL_Server::Cursor) so that you don't have to use braces in most cases (except in literal SQL, in those cases you will have to add the braces yourself.) Slay for transparency, but literal SQL is on you. π€
β±οΈ fractional seconds
Fractional seconds with DBIx::Class::InflateColumn::DateTime are not currently supported, datetimes are truncated at the second. That's the situation right now. π
π«Ά FURTHER QUESTIONS? π«Ά
Check the list of additional DBIC resources. That's the official move. β¨
π COPYRIGHT AND LICENSE π
This module is free software copyright by the DBIx::Class (DBIC) authors. You can redistribute it and/or modify it under the same terms as the DBIx::Class library.
Okay bestie, that's the whole page. It was served to you by perl v5.42.0 on 2025-01-22, and the manual page is DBIx::Class::Storage::DBI::ADO::Microsoft_SQL_Server(3) β User Contributed Perl Documentation, periodt. π
π
π¦ where this page comes from
- opensuse-leap 16.0: perl-DBIx-Class 0.082844-bp160.1.10 Β· Artistic-1.0 OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms