From fcd7b64a4b66c44eaa73eab10c2c1d7da02e9da7 Mon Sep 17 00:00:00 2001 From: Sergei Morozov Date: Wed, 31 Mar 2021 13:24:19 -0700 Subject: [PATCH] Use lower-case object names in PDO::lastInsertId($name) (#1245) --- source/pdo_sqlsrv/pdo_dbh.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/pdo_sqlsrv/pdo_dbh.cpp b/source/pdo_sqlsrv/pdo_dbh.cpp index e25168fd1..87657efea 100644 --- a/source/pdo_sqlsrv/pdo_dbh.cpp +++ b/source/pdo_sqlsrv/pdo_dbh.cpp @@ -34,7 +34,7 @@ namespace { const char LAST_INSERT_ID_QUERY[] = "SELECT @@IDENTITY;"; const size_t LAST_INSERT_ID_BUFF_LEN = 50; // size of the buffer to hold the string value of the last inserted id, which may be an int, bigint, decimal(p,0) or numeric(p,0) -const char SEQUENCE_CURRENT_VALUE_QUERY[] = "SELECT CURRENT_VALUE FROM SYS.SEQUENCES WHERE NAME=%s"; +const char SEQUENCE_CURRENT_VALUE_QUERY[] = "SELECT current_value FROM sys.sequences WHERE name=%s"; const int LAST_INSERT_ID_QUERY_MAX_LEN = sizeof( SEQUENCE_CURRENT_VALUE_QUERY ) + SQL_MAX_SQLSERVERNAME + 2; // include the quotes // List of PDO supported connection options.