Best solution to import records from MySQL database to MS SQL (Hourly) - mysql

I need to import records stored in a MySQL Database that I do not maintain into my Sql Server 2005 database (x64)
We should import the records at an interval basis (probably 1 hour).
What would be the best solution to perform the regular import?
Windows Service (using reference MySql.data dll)
Windows Client (could make it automated)
SQL Extended Stored Procedure (is it possible to reference the MySQL.data dll?)
SSIS package - Install MySQL ODBC driver
The problem with #4 is that I do not really want to support the ODBC driver on the sql server.
I'm not sure if you can even reference the x86 MySql.data dll into a x64 sql server process for #3. (Or if you can even reference that dll within a sql server project)

If it were mine to do, I'd go the SSIS route. Sure, you'll "maintain" the ODBC driver on the server, but compared to the maintenance (and development time and headaches) of the other 3 options, that seems to be the simplest route.

What abaut MySql -> *.DAT (per table) -> FTP to WINSERVER -> SSIS to SQL

4.SSIS package - Install MySQL ODBC driver would be the best solution.

Related

Unable to access Visual FoxPro database through MS Access 2013

I am trying to access a Visual FoxPro Database through MS Access 2013 on a Windows 7 Machine, but I am getting this error.
"specified driver could not be loaded due to system error 0. The operation completed successfully(Microsoft Visual FoxPro Driver C:\Windows\system32\vfpodbc.dll).(#160)"
I tried installing Microsoft OLE DB Provider for Visual FoxPro 9.0 SP2 but I am getting the same results.
Any help is much appreciated.
You cannot use OLEDB with Access, can you? If you can then it is straight forward with VFPOLEDB driver.
You cannot use VFP ODBC driver if database version is later than VFP6.
If you are in a need to downgrade to access (which I never classify as a "database") then you could use Excel in between. Excel can import data using OLEDB (but strangely access can't, go figure). Or if you know how to write VBA code in access then maybe you could utilize the OLEBD driver from there too.
Another option might be to get the data to SQL server express via OleDb, then from SQL server to access (yet a bigger downgrade).
Another option would be to use code for this. If it were from VFP it would be as easy as 1,2,3 creating a cursor adapter or remote view to access and pumping data there. With C# too you can create connections to both sides, read from one and write to the other.
If I were you, I wouldn't choose to downgrade to access, but maybe upgrade to postgreSQL, MS SQL, ...
PS: Check out Advantage Database Server. It was supporting ODBC for VFP (local server version for free). That might be your option.
PS2: Access can import XML, right? Maybe you would want to export VFP data as XML and import from there.

How to import existing database from SQL Server into MySQL?

Is there any software that I can use to do this, or do I need to create a dump file from SQL Server that is compatible with MySQL?
If you can get the MySQL ODBC driver installed you can do the transfer with SQL Server management Studio (or whatever they're calling it now).
It doesn't do a great job with metadata so you'll probably have to deal with the constraints manually, as well as tweak the column definitions, but it will transfer the data.

How to attach database in SQL Server 2008 which was created in SQL Server 2012

I have two database files named as .mdf and .ldf which are created in SQL Server 2012 and now on my pc I installed Visual Studio 2010 and SQL Server 2008 Express.
When I try to attach these database files to SQL Server 2008 it gives me error.
The database 'C:\PROGRAM FILES\MICROSOFT SQL
SERVER\MSSQL10.SQLEXPRESS\MSSQL\DATA\CMS_DB.MDF' cannot
be opened because it is version 706. This server supports version 655
and earlier. A downgrade path is not supported.
Could not open new database 'C:\PROGRAM FILES\MICROSOFT SQL
SERVER\MSSQL10.SQLEXPRESS\MSSQL\DATA\CMS_DB.MDF'. CREATE
DATABASE is aborted.
An attempt to attach an auto-named database for file C:\Program
Files\Microsoft SQL
Server\MSSQL10.SQLEXPRESS\MSSQL\DATA\CMD_DB.mdf failed. A
database with the same name exists, or specified file cannot be opened,
or it is located on UNC share.
When open database in ssms 2008 then error :
Attach database failed for Server 'MATRIX-PC\SQLEXPRESS'. (Microsoft.SqlServer.Smo)
Additional information:
An exception occured while executing a Transact-SQL statement or batch.
(Microsoft.SqlServer.ConnectionInfo)
The database 'C:\USERS\RAJ\DESKTOP\COLLEGE MANAGEMENT SYSTEM(.NET 4.5)\ COLLEGE MANAGEMENT SYSTEM\BIN\DEBUG\CMD_DB.MDF' cannot be opened because it is version 706.
This server supports version 655 and earlier. A downgrade path is not supported.
Could not open new database 'C:\USERS\RAJ\DESKTOP\COLLEGE MANAGEMENT SYSTEM(.NET 4.5)\COLLEGE MANAGEMENT SYSTEM\BIN\DEBUG\CMD_DB.MDF'. CREATE DATABASE is aborted.
(Microsoft SQL Server, Error: 948)
No, you can only move forward.
This means, you can restore the database from 2005 or 2008 to 2012 version but can not do it in reverse order. The next most popular question I receive is if we can’t restore a SQL Server 2012 database to earlier version what is the next best option?
I have personally faced this issue once before and I had manually created T-SQL script using Script and Data Generator Wizard in SQL Server 2012 and rebuild my database in
SQL Server 2008R2. If you have many different databases which you want to address, you can use SSIS to
automate the script generation.
As noted if you want to access a 2012 db from 2008 you will have to migrate the database back to 2008. This will only be possible if you have not used 2012-specific features in the db. If you have and still want to perform the migration you should first try and identify these where they occur and fix those first.
As noted above one option is to generate T-SQL scripts and use these to regenerate the db in 2008. However for a large db this could be time consuming and hard work to get to actually work.
A better option than using the SSMS scripting wizard is to use a similar tool available on Codeplex called SQL Database Migration Wizard - http://sqlazuremw.codeplex.com/releases/view/32334. You want the latest version v4.x to work with SQL Server 2012.
The tool is originally intended to be used for migrating databases between SQL Server and Azure. However the tool works just as well between SQL Server 2012 and SQL Server 2008. The trick is to set SQL Server rather than Azure as the target in the advanced options.
The reason this is a better option than the SSMS scripting wizard is that it uses BCP for the data transfer rather than TSQL and so is much more efficient. I migrated a 7GB database in about 2 hours with this with most of the time spent drinking tea while the machine worked away. Importantly, it all just worked with no requirement for me to start editing files to fix problems like too many commands, timeouts etc.

SSIS how to import data from Paradox?

I'm trying to import data coming from a Paradox Database (all files *.DB are located in a folder) to Sql server 2008 with SSIS 2008.
From my OLE DB Source, I created a new Connection using Jet 4.0 OLE DB Provider and then specified "Paradox 5.0" in Extended Properties but when testing the connection I get every time the same error : " ISAM Driver not found"
Any idea how to solve this ?
Thanks a lot
Run into this problem recently when trying to import Paradox 5.x files to SQL Server 2008 R2 via SSIS in Windows 7.
What was missing?
The Borland Database Engine (BDE). I have installed the 5.2.0.2 version downloaded at www.prestwood.com. You need to register into the site in order to get it. This is the name of the downloaded zip file "mprestwood_KB100537_attachment.zip".
So, after installing the BDE, solved the problem with these steps (witch i think all of you should already have tried with no success):
Create a System DSN with the Paradox Driver, using ODBC 32 bit Manager, usualy at <drive>:\Windows\SysWOW64\odbcad32.exe, configuring it to point to the folder where the paradox .DB files are.
In SSIS, create an ADO.Net connection manager using the previous created DSN
Configure the created connection manager to use the provider ".Net Providers\Odbc Data Provider", and in the Data source specification select the created system dsn
In a Data Flow Task, add an ADO Net Source using the created connection manager
"Automagicaly" everything goes as it should, you can see the paradox files appearing as tables, their columns, etc. Now you only have to choose your destination...
Hope this helps, i sure wasted a great deal of time to get this running... but is running, time to move on...
JB

Given a SQL Server 2008 R2 *.mdf file, how can I import it to MySQL?

I've got a small SQL Server 2008 R2 *.mdf database file. I'm running Ubuntu and don't have SQL Server 2008 installed (and would prefer not to install it into my VM, if at all possible).
How can I import this data into a MySQL instance? Is this possible?
And MDF file is an internal file to SQL Server. One way to import it would be to attach it to a SQL Server and then exporting the data
SQL Integration Services
Custom Code
Using a conversion tool such as those listed in this article: Migrating from Microsoft SQL Server and Access to MySQL
However since you don't want to install SQL Server one suggestion perhaps using MONO to attach the mdf as datacontext in their equivalent of Linq2SQL and reading the data out your self.