W3cubDocs

/Yii 2.0

Class yii\db\mssql\SqlsrvPDO

Inheritance yii\db\mssql\SqlsrvPDO » PDO
Available since version 2.0
Source Code https://github.com/yiisoft/yii2/blob/master/framework/db/mssql/SqlsrvPDO.php

This is an extension of the default PDO class of SQLSRV driver.

It provides workarounds for improperly implemented functionalities of the SQLSRV driver.

Public Methods

Method Description Defined By
lastInsertId() Returns value of the last inserted ID. yii\db\mssql\SqlsrvPDO

Method Details

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.

© 2008–2017 by Yii Software LLC
Licensed under the three clause BSD license.
http://www.yiiframework.com/doc-2.0/yii-db-mssql-sqlsrvpdo.html