Hello,

I'm having problems migrating Drupal 7 from our current server (Windows 2008, IIS7, PHP 5.2, SQL Server 2005) to a new one (Windows 2008R2, IIS7.5, PHP 5.4 NTS with FastCGI 32bit, SQL Server 2008).

I installed the SQL Native Client 2012 as well as SQL/PHP Driver 3.0. The website itself runs fine and delivers content. But when I try to clear the cache Drupal tells me that "an error occured on the server". I've set pdo_sqlsrv.log_severity = 1 in php.ini.

These are errors I get in the PHP error log:

[11-Sep-2012 10:51:01 UTC] pdo_sqlsrv_dbh_set_attr: SQLSTATE = IMSSP
[11-Sep-2012 10:51:01 UTC] pdo_sqlsrv_dbh_set_attr: error code = -39
[11-Sep-2012 10:51:01 UTC] pdo_sqlsrv_dbh_set_attr: message = The given attribute is only supported on the PDOStatement object.
[11-Sep-2012 10:51:01 UTC] pdo_sqlsrv_stmt_fetch: SQLSTATE = IMSSP
[11-Sep-2012 10:51:01 UTC] pdo_sqlsrv_stmt_fetch: error code = -15
[11-Sep-2012 10:51:01 UTC] pdo_sqlsrv_stmt_fetch: message = The active result for the query contains no fields.
[11-Sep-2012 10:51:05 UTC] pdo_sqlsrv_stmt_execute: SQLSTATE = 42S02
[11-Sep-2012 10:51:05 UTC] pdo_sqlsrv_stmt_execute: error code = 208
[11-Sep-2012 10:51:05 UTC] pdo_sqlsrv_stmt_execute: message = [Microsoft][SQL Server Native Client 11.0][SQL Server]Ungültiger Objektname 'profile_field'.
[11-Sep-2012 10:51:06 UTC] pdo_sqlsrv_stmt_fetch: SQLSTATE = IMSSP
[11-Sep-2012 10:51:06 UTC] pdo_sqlsrv_stmt_fetch: error code = -15
[11-Sep-2012 10:51:06 UTC] pdo_sqlsrv_stmt_fetch: message = The active result for the query contains no fields.
[11-Sep-2012 10:51:06 UTC] pdo_sqlsrv_stmt_fetch: SQLSTATE = IMSSP
[11-Sep-2012 10:51:06 UTC] pdo_sqlsrv_stmt_fetch: error code = -15
[11-Sep-2012 10:51:06 UTC] pdo_sqlsrv_stmt_fetch: message = The active result for the query contains no fields.
[11-Sep-2012 10:51:06 UTC] pdo_sqlsrv_dbh_last_id: SQLSTATE = IMSSP
[11-Sep-2012 10:51:06 UTC] pdo_sqlsrv_dbh_last_id: error code = -46
[11-Sep-2012 10:51:06 UTC] pdo_sqlsrv_dbh_last_id: message = An error occurred retrieving the last insert id.

The thing is, when I began to set up this server I didn't install SQL Server 2008 first, instead I pointed the installation to the old web server running SQL Server 2005. So only the Native Client 2012 was installed. From what I remember I had no issues clearing the cache. Only since the install of SQL Server 2008 on the webserver this error occurs (I don't know about the errors in the error log above since I didn't have set pdo_sqlsrv.log_severity enabled).

We've already posted the same question in the MSDN forum and have been referred to ask here: http://social.msdn.microsoft.com/Forums/en/sqldriverforphp/thread/005125...

Does anyone know what could be the reason for this problem?

Many thanks in advance!

UPDATE

Regarding the truncate table problem while cache clearing:
The reason was that the database user only had the db_datareader and db_datawriter roles and was not allowed to execute TRUNCATE since it's an DDL operation (see http://msdn.microsoft.com/en-us/library/ms177570.aspx). I added the db_owner role and now it's working. So the main issue I was having had nothing to do with the errors I posted above.

However while the site seems to be fine those errors still do occur. I also enabled error tracing on the old (current) server and now I have the very same errors all over the php error log! I just never noticed because logging is disabled by default, and they don't show up in Drupal. Are these errors expected and catched in the Drupal layer? If not, do I have to fear any unexpected behaviour of our website or are these errors harmless?

Comments

agoradesign’s picture

Issue summary: View changes

New insights: solved the Cache-clearing problem, still have the errors in log

DamienMcKenna’s picture

Title: Problems with Windows 2008R2 IIS7.5 PHP 5.4 using PDO_SQLSRV and SQL Server 2008 » Errors reported with Windows 2008R2 IIS7.5 PHP 5.4 using PDO_SQLSRV and SQL Server 2008
Component: Miscellaneous » Code
Category: Support request » Bug report

Seems like this is a bug.

david_garcia’s picture

Status: Active » Closed (cannot reproduce)

Please provide detailed stack trace along with versions of sql server pdo, php and sql server driver.

Greetings.