Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
PDO Connections to MS-SQL Server are using wrong SQL syntax #3142
There is the problem, that all PDO-Connections to SQL-Server are using the SQL92-Platform-Syntax. So it is currently not possible to use ZF2 with an MS-SQL-Server using the PDO drivers!
This is done by \Zend\Db\Adapter\Adapter.php in the function createPlatformFromDriver.
So in example a simple query to a MS-SQL-Database builded by TableGateways fetchall() looks like this an causes an error:
SELECT "Tablename".* FROM "Tablename"
The "native" Driver "SqlServer" for Microsoft-SQL-Server can only be used on windows platforms. This is not applicable in most cases.
It's the same with Mysql. I updated
public function getDatabasePlatformName($nameFormat = self::NAME_FORMAT_CAMELCASE)
Then do $adapter->getPlatfrom() return 'Mysql', but table and fields names quoted with " as in Sql92 defined, not with ` as in Mysql platform.
Sorry. But this not solves the problem for me using MS-SQL with pdo adapter.
return new Platform\SqlServer();
But that's not very nice :-(
for linux i use: