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?


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/… – John Mitchell Oct 22 '15 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. – cilefen Oct 23 '15 at 14:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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