PHP Class yii\db\mssql\SqlsrvPDO

It provides workarounds for improperly implemented functionalities of the SQLSRV driver.
Since: 2.0
Author: Timur Ruziev ([email protected])
Inheritance: extends PDO
Show file Open project: yiisoft/yii2

Public Methods

Method Description
lastInsertId ( string | null $sequence = null ) : integer Returns value of the last inserted ID.

Method Details

lastInsertId() public method

SQLSRV driver implements [[PDO::lastInsertId()]] method but with a single peculiarity: when $sequence value is a null or an empty string it returns an empty string. But when parameter is not specified it works as expected and returns actual last inserted ID (like the other PDO drivers).
public lastInsertId ( string | null $sequence = null ) : integer
$sequence string | null the sequence name. Defaults to null.
return integer last inserted ID value.