Hi, Every body I have a 1000 products SQL database with product name, description, images, stock, ..., on a local MS sql Server that i use to local billing system, can i use Drupal 7 to build a product catalog website to display products info and stock availability whit the existing database, I guess that SQL table strutucture are differente or fields names? please help me know that is it possible, thanks in advance for your reply.

Comments

acwebb’s picture

Wow....this is a good question.

I'm interested too.

socceronly’s picture

Could you output the db as a csv file?

If so you could then use the Feeds module to import the csv into nodes.

victor505’s picture

Hi!, socceronly, thanks for you reply, yes i can output the DB as CSV file but the idea is to use the same MS SQL database with Drupal, so when i update the stock info in the exisiting MS SQL DB the Drupal product catalog page display the same data, i want to integrate the existing MS SQL DB with Drupal is that possible?

Best regards!

acwebb’s picture

Why is important to stick with Microsoft SQL?

Why not use MYSQL or another database SQL language?

thenuke’s picture

new to Drupal and I want to know how to continue using the MySql databases and tables. in one db alone I have 40 tables that are critical reference tables as well as the various relational tables for client information and cross referencing. How do I make this work? I'm not finding the integration on the Drupal site that is helpful.

pbo’s picture

Notice i'm new to drupal but i've followed the entity tutorials and you are able to load and save entities from other databases. What you need to do is import the schema using the schema api, then define your entities and build a controller that is able to do the load and save part. You are then able to connect views and field api with it.

I have to say though i think its way to complicated solution to do something basic like this.... but maybe its because i'm new to drupal.

Paul

ransom’s picture

it will be some work. The "drupal way" is not always the easiest if you are not familiar with it.

http://drupal.org/writing-secure-code Has some good tips on how to make proper queries.
http://api.drupal.org/api/drupal/includes%21database%21database.inc/group/database/7 will help you understand a bit of the code.

Don't edit core but don't let it stop you from viewing core. Some of if not the best samples on how to code xyz in drupal come from core. Open up modules/node & books and see how drupal does it. Heck copy it over & find/replace the name with something new in a sandbox & replace it.

http://drupal.org/project/examples more examples!

If you want to add and manage products you'll probably want fieds. Mapping data fields is different than nodes.

http://www.ubercart.org/ & http://drupal.org/project/commerce are also good places to start people with the same problem have paved that road a bit fore you and you can find examples of how to do that in those systems.

best of luck.

aaewen’s picture

Also very interested. This is what we face out there dealing with clients. They have existing database that we cannot even touch.

c.breschkow’s picture

I think the best way is to create an own module. In this module connect with the custom database and set your query. Get the data from this query and set the fields of your content type with this data. Update the content types with every cron run.

Pierre.Vriens’s picture

arikch’s picture

The easiest way to do that is by using Google Cloud SQL.
It supports connections using the MySQLdb module and in addition It can be used to run in both production
and on dev_appserver by using a local MySQL server.

תביעה ייצוגית

KimberlyBulhoes’s picture

Hi,

How did you solve the problem? I'm trying to do the same. I have a local ms sql server, and want to automatically sync with mysql, there for having stocks in sync etc etc

Thanks

KimberlyBulhoes’s picture

What I did was, I first created a Commerce product type with all the needed fields. Then installed feeds importer and commerce feeds. With this you can map your external database table to your creates commerce product.

For the external database to show up you have to have linked server on mssql side.