1 package DBIx::Class::Storage::DBI::MSSQL;
6 use base qw/DBIx::Class::Storage::DBI::AmbiguousGlob DBIx::Class::Storage::DBI/;
9 __PACKAGE__->sql_maker_class('DBIx::Class::SQLAHacks::MSSQL');
11 sub _dbh_last_insert_id {
12 my ($self, $dbh, $source, $col) = @_;
13 my ($id) = $dbh->selectrow_array('SELECT SCOPE_IDENTITY()');
17 sub build_datetime_parser {
19 my $type = "DateTime::Format::Strptime";
21 $self->throw_exception("Couldn't load ${type}: $@") if $@;
22 return $type->new( pattern => '%Y-%m-%d %H:%M:%S' ); # %F %T
25 sub sqlt_type { 'SQLServer' }
28 my ( $self, $opts ) = @_;
31 $self->{_sql_maker_opts} = { %$opts };
34 return { limit_dialect => 'Top', %{$self->{_sql_maker_opts}||{}} };
41 DBIx::Class::Storage::DBI::MSSQL - Storage::DBI subclass for MSSQL
45 This subclass supports MSSQL, and can in theory be used directly
46 via the C<storage_type> mechanism:
48 $schema->storage_type('::DBI::MSSQL');
49 $schema->connect_info('dbi:....', ...);
51 However, as there is no L<DBD::MSSQL>, you will probably want to use
52 one of the other DBD-specific MSSQL classes, such as
53 L<DBIx::Class::Storage::DBI::Sybase::MSSQL>. These classes will
54 merge this class with a DBD-specific class to obtain fully
55 correct behavior for your scenario.
63 =head2 build_datetime_parser
65 The resulting parser handles the MSSQL C<DATETIME> type, but is almost
66 certainly not sufficient for the other MSSQL 2008 date/time types.
70 Brian Cassidy <bricas@cpan.org>
74 You may distribute this code under the same terms as Perl itself.