X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FDBIx%2FClass%2FStorage%2FDBI%2FMSSQL.pm;h=51c4e025ef480dfd1f659e3adb1b3f75bc17c146;hb=0e40881e00dcc27fb292708f9199c6f4c0947312;hp=38653f60169fbd564b9cc98418498de8b9f42ea7;hpb=3885cff6485aba6a4708efb7f98877bc8e5d4369;p=dbsrgits%2FDBIx-Class.git diff --git a/lib/DBIx/Class/Storage/DBI/MSSQL.pm b/lib/DBIx/Class/Storage/DBI/MSSQL.pm index 38653f6..51c4e02 100644 --- a/lib/DBIx/Class/Storage/DBI/MSSQL.pm +++ b/lib/DBIx/Class/Storage/DBI/MSSQL.pm @@ -3,10 +3,11 @@ package DBIx::Class::Storage::DBI::MSSQL; use strict; use warnings; -use base qw/DBIx::Class::Storage::DBI::Sybase/; +use base qw/DBIx::Class::Storage::DBI/; -sub last_insert_id { - my( $id ) = $_[0]->_dbh->selectrow_array('SELECT @@IDENTITY' ); +sub _dbh_last_insert_id { + my ($self, $dbh, $source, $col) = @_; + my ($id) = $dbh->selectrow_array('SELECT SCOPE_IDENTITY()'); return $id; } @@ -26,13 +27,17 @@ DBIx::Class::Storage::DBI::MSSQL - Storage::DBI subclass for MSSQL =head1 SYNOPSIS -This subclass supports MSSQL. As MSSQL is usually used via a -differently-named DBD such as L, it does not get -autodetected by DBD-type like the other drivers, and you will need to -specify this storage driver manually, as in: +This subclass supports MSSQL, and can in theory be used directly +via the C mechanism: $schema->storage_type('::DBI::MSSQL'); - $schema->connect_info('dbi:Sybase:....', ...); + $schema->connect_info('dbi:....', ...); + +However, as there is no L, you will probably want to use +one of the other DBD-specific MSSQL classes, such as +L. These classes will +merge this class with a DBD-specific class to obtain fully +correct behavior for your scenario. =head1 AUTHORS