Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
SQLSTATE[42S02]: [Microsoft][SQL Server Native Client 11.0][SQL Server]Invalid object name 'watchdog'.
This error occurs right after the following during Drupal 7.21 installation (shown in the error report). It hangs at the start of Install Profile:
Installation tasksChoose profile(done)Choose language(done)Verify requirements(done)Set up database(done)Install profile(active)Configure siteFinished SQLSTATE[42S02]: [Microsoft][SQL Server Native Client 11.0][SQL Server]Invalid object name 'watchdog'.
Any clue?
Thx
Steve
Comments
Comment #1
Mickey_Rat CreditAttribution: Mickey_Rat commentedMore information, as I was able to get thru D7 installation finally.
Prior to the SQL error, I had received several warnings related to function removeFieldsInCondition in query.inc. With this issue fixed, the SQL error following database creation did not recur. I made the following code change, per the following support issue, to includes/database/sqlsrv/query.inc
http://drupal.org/node/1635002
/* foreach ($condition->conditions() as $child_condition) {
* if ($child_condition['field'] instanceof QueryConditionInterface) {
* $this->removeFieldsInCondition($fields, $child_condition['field']);
* }
* else {
* unset($fields[$child_condition['field']]);
*/
foreach ($condition->conditions() as $key => $child_condition) {
if ($key !== '#conjunction') {
if ($child_condition['field'] instanceof QueryConditionInterface) {
$this->removeFieldsInCondition($fields, $child_condition['field']);
}
else {
unset($fields[$child_condition['field']]);
}
Comment #2
Norberto Ostallo CreditAttribution: Norberto Ostallo commentedI tested this solution and it works with the latest stable release, but this issue has already been fixed in the latest -dev.
I suggest using it in stead of manually applying this correction.