开发者

Symfony: Build doctrine schema out of sql azure db

My DSN String looks like this:

  dsn:      odbc:DRIVER={SQL Server};Server=myserver.database.windows.net;Database=mydb;
  username: myusername@myserver
  password: mypwd

When I run the symfony task:

symfony doctrine:build-schema

It seems be a successfull connection, but it breaks with the following error:

SQLSTATE[开发者_开发知识库42000]: Syntax error or access violation: 2812 
[Microsoft][SQL Server Native Client 10.0][SQL Server]Could not find stored procedure
'sp_primary_keys_rowset'. (SQLExecute[2812] at ext\pdo_odbc\odbc_stmt.c:254). 
Failing Query: "EXEC sp_primary_keys_rowset @table_name = Appointment"

Does anybody know what's the problem here? I could not find any useful information about there error codes.

I use symfony 1.4.10, PHP 5.3, SQL Azure.


Does the stored procedure sp_primary_keys_rowset exist in your database?


I found the solution:

In symfony/lib/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Import/Mssql.php listTableColumns($table) I had to change

$sql = 'EXEC sp_primary_keys_rowset @table_name = ' . $this->conn->quoteIdentifier($table, true);

to

$sql = 'EXEC sp_pkeys @table_name = ' . $this->conn->quoteIdentifier($table, true);
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜