I have an external MS SQL Server database that I can display some of its contents within the Drupal 7 views module via the Views Database Connector module.

How can I within Drupal 7 make updates to an external MS SQL Server database?

1 Answer 1


Use the Drupal database API to manipulate the data in the other database. You can use db_set_active() to switch to the other database.

  • Instead of using db_set_active() to switch to the other database I think a better approach is the recommended answer within this link: stackoverflow.com/questions/4839063/… Commented Oct 22, 2015 at 17:31
  • I was citing the official handbook. That said, weird things can happen to things like watchdog() while you are connected to the other database with db_set_active(). And, this question is actually a duplicate of the one you linked.
    – mona lisa
    Commented Oct 23, 2015 at 14:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.