I've made necessary modifications so my MAMP on my OSX (where my D7 site is located) can interact with another MS SQL server via PHP (http://www.tumblr.com/tagged/mssql+mamp+php+mac+osx).

I downloaded the Drupal 7 SQL Server Module (http://drupal.org/project/sqlsrv), and enabled it.

Finally, using the Feeds SQL module, I attempt to create/update a bunch of "Profile" content type, by grabbing information from the SQL server. However, I don't think it can make the connection from my MAMP. I was able to copy certain tables from a database on the SQL server and import it to my database on the OSX MAMP site, and Feeds SQL module worked internally.

Below is what my settings.php looks like:

$databases = array (
'default' =>
array (
'default' =>
array (
'database' => 'drp_1',
'username' => 'jimbobski',
'password' => 'iHaveAHottGf',
'host' => 'localhost',
'port' => '',
'driver' => 'mysql',
'prefix' => '',
),
), 'custom' =>
array (
'default' =>
array (
'database' => 'profile',
'username' => ''jimbobski',
'password' => 'iHaveAHottGf',
'host' => 'localhost',
'port' => '',
'driver' => 'mysql',
'prefix' => '',
)
)
);

Comments

chandravilas’s picture

It is also possible to establish connection with other database at module level or for separate(single) module...

 $mymodule_database = array(
      'database' => 'db_name',
      'username' => 'u_name', 
      'password' => 'pwd',     

      'host' => 'localhost',
      'driver' => 'mysql', 
  );

Database::addConnectionInfo('db_key', 'default', $mymodule_database);

db_set_active('db_key'); // Initialize a connection

db_set_active();  // it will set back database connection with default database..