Hi,
When connected to MSSQL using PDO and executing a simple insert query I get this error:
<code>PDOException [ IM001 ]: SQLSTATE[IM001]: Driver does not support this function: driver does not support lastInsertId()</code>
<code>COREPATH/classes/database/pdo/connection.php @ line 178</code>
I have found a tmp fix (psudeo), but im not sure how or where to implement this?
<code>
public function lastInsertId() {
if (dbms == 'mssql') {
$res = query('SELECT SCOPE_IDENTITY() as last_id');
return last_id;
}
return parent::lastInsertId();
}
</code>
The query builder currently only supports MySQL completely. The PDO driver is a generic driver, that doesn't know the MSSQL specifics.
I'm working on a improved QB in the feature/sqlbuilder branch, which currently has a MSSQL specific PDO driver which already supports limit() and offset(). I'll add this to the todo list for that driver.