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