Quote:
|
Originally Posted by lionheart008
Not a 'demanding' amount of times, perhaps a few times per month. And no its not a crucial export. Basically the SQL server DB holds lots of product information and it's used internally for various uses. All the information about the products is used on the website in a product listing. So when a person makes a change internally, everywhere now and then I would like an easy way of sending the changes to the web database. Initially, an entire database migration would be needed but then, If there was a way when a query would be sent to the server every time a certain row is edited in the SQL server DB.... That would suit me best.
I'm no database expert, but I thought ODBC could be used for this. Like http://dev.mysql.com/downloads/connector/odbc/3.51.html I'm more of a designer/scripter then a database guru by any means. Mysql is the only one I'm familar with, never worked with SQL server before.
|
As I'm sure you know, ODBC is just a connection protocol. It doesn't "do things" on an application level - like replication. I've never used MySQL but I assume an ODBC connection can be established for it, same as SQL Server. I've used ODBC to connect a Database Management tool (Enterprise Manager) so I know it will support all levels of database update.
SQL Server (as with all enterprise level databases) supports triggers. They require programming, but they are a good way to capture all changes. However that's a lot of programming and has a performance hit.
I presume you need to capture things like Product Description, price, whether it's still active, etc. Doesn't sound like you need stuff like dynamic info like stock levels.
SQL Server uses "Enterprise Manager" (comes free) for things like creating/editing database objects, exporting data, setting up replication to another SQL Server (also built in). Check out the Export function.
If the data is pretty static and small (like maybe 10,000 rows in 5 or 6 tables), here's something similar to what I did for a customer who needs this information regularly (they use MySQL for their web server). We didn't want to spend a lot of programming effort and the tables exported weren't considered so confidential that we were concerned with a customer (who has signed a non-disclosure) getting a full copy. Took a total of about 30 minutes for my part.
1. Create the same table structure in MySQL for the tables you want exported. (my customer did this following my first export).
2. Create a scheduled DTS job in SQL to export those tables from SQL to these MySQL tables. Be warned; it's very dumb about it, to the point of trying to repeat even unique keys so you have to clear out your "to" tables first. There's a wizard in SQL server for creating an export. (actually; I create Excel spreadsheets - one of the options). You can export query results if you want to apply a filter or join some tables first - and guarentee the process won't break if you make changes in your SQL Server database.
3. Create MySQL tables that your reports will actually use. (my customer's task)
4. Write a MySQL job also to be scheduled to run after hours and after the SQL export one completes. Could even be a day later. This job will compare the freshly imported files with your report files. That way, if structures change your existing reports don't break. Also; you may not want to keep a full set of data in the tables you expose to the web programs. (I do the export when they request an update - about every 6 months).
Or; buy some replication software that's capable of doing a single-direction replication from SQL Server to MySQL. You could also develop a local application in your language of choice that simply opens both databases and does an intelligent re-sync.
If your web were running via SQL Server, you could use the built in replication feature. Of course; you then have all sorts of licensing expenses - replication software is likely cheaper.
Surely there are better solutions that involve an XML interface or something, but that's beyond me. SQL Server has the "OPENDATASOURCE" keyword, implying that you can create your own data transfers.