Skip to content

Commit

Permalink
Remove redundant implementation of PDO\SQLSrv\Connection::lastInsertI…
Browse files Browse the repository at this point in the history
…d($name)
  • Loading branch information
morozov committed Mar 30, 2021
1 parent 012569d commit 4d69ed3
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions src/Driver/PDO/SQLSrv/Connection.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,7 @@ public function exec(string $sql): int
*/
public function lastInsertId($name = null)
{
if ($name === null) {
return $this->connection->lastInsertId($name);
}

return $this->prepare('SELECT CONVERT(VARCHAR(MAX), current_value) FROM sys.sequences WHERE name = ?')
->execute([$name])
->fetchOne();
return $this->connection->lastInsertId($name);
}

/**
Expand Down

0 comments on commit 4d69ed3

Please sign in to comment.