db\mssql\SqlsrvPDO lastInsertId()

lastInsertId() public method

Returns value of the last inserted ID.

SQLSRV driver implements yii\db\mssql\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 integer lastInsertId ( $sequence = null )
$sequence string|null

The sequence name. Defaults to null.

return integer

Last inserted ID value.

doc_Yii
2016-10-30 16:58:25
Comments
Leave a Comment

Please login to continue.