Importing data to MySQL from MS SQL - sql

I want to import data from MS SQL Server, run it through some sort of regexp to filter out stuff, and import it into MySQL. I then, for each query, wish to display a relevant image from a third database. What would be the easiest way to do this, importing and linking wise?
Thank you.
Clarification: It is a php application to filter data from another database, and then for each record show an associated image from a 3rd database. It is from scratch...

You can try the MySQL Migration Toolkit.
http://dev.mysql.com/downloads/gui-tools/5.0.html
Now archived at http://downloads.mysql.com/archives.php?p=mysql-migration-toolkit

use SQL Management Studio (or Enterprise Manager depending on version) with the SQL Server import wizerd to get it into MS SQL.
From there you can export it to Mysql using the MySQL connector drivers.
As for as displaying an image from a third database, that is completely up to the code you have written in your application.

I would use the Microsoft SQL Server Data Publishing Wizard (free). You can use it to script your entire database (including insert statements.) You'll have to edit this script a little bit probably to get it to run in MySQL. Now you just have a regex problem. You can try:
Manipulating the data in MS SQL via a query, or from code (using regex) the transfer.
Running your regexes on the script file itself, maybe try some macros, find and replace, etc.
Manipulating the data in MySQL via a query, or from code (using regex) after the transfer.

Related

Convert MS Access 2010 query to SQLite query

I have a query in MS Access database. I want to run this query in SQLite database. I wondering whether there is a easy way to convert the code or just change step by step?
You have several options available for viewing the contents of a sqlite database and running queries against it. When building sqlite from source you can choose to build the shell utility.
If you want something more turnkey you can install a free tool such as Sqlite Manager for Firefox or Sqlite Browser.
In both apps you can copy-and-paste your SQL that you want to execute against a SQLITE database file. Good luck!

Importing Multivalue DB with SSIS into SQL

I would like to know if it is possible to Transfer Data into SQL Server from a multi value database file using SSIS.
The only thing that I could find online was using a bluefinity tool to achieve this.
Thanks
Simona
I have done this from Universe, but Universe has an ODBC driver that allows the datavase to be viewed as if they were tables. Almost like SQL views.
SSIS can import from almost anything that you can get either a .Net, ODBC, or OLE DB driver for. There has to be someway to talk to the DB from an extrnal program, though.
I suspect that you has no driver (ODBC,OLEDB,.NET). So you can use C# script (even from SSIS) and extract data to flat file and then to SQL Server or do it directly to SQL Server.

Moving from Microsoft Access 2007 to Sql Server 2005

I have MS Access 2007 Databases and VBA modules associated with it.
I Now want to upgrade my project so as to use Sql Server 2005 and Vb.net using visual studio.net.
Can any one suggest Complete details on the transfer without much hassle or data loss.?
Thanks In Advance
Per RBarry's answer...the data migration to SQL Server is easy using the SQL Server Migration wizard. Then you will have a working microsoft access application (probably but maybe it will require polishing and tweaking).
To convert the front end (ui) to vb.net there might be a converter but even if there is one you would likely have to do a lot of it manually anyway. So you treat the access version like a prototype and you start building your app in vb.net by hand.
Seth
Start with the Ms-Access SSMA site: http://www.microsoft.com/sqlserver/2005/en/us/migration-access.aspx
I am not aware of a migration guide specifically for Access -> SqlSever, however, there is a very extensive Oracle -> SqlServer Migration Guide that you could easily cherry-pick for a project plan.
I use SQL Server to import data from Access databases. Be aware that it won't import your keys or relationships- you'll need to recreate those.
Your VBA code is specific to Access. You'll need to rewrite it in VB.NET.
The Access queries are probably going to cause you the most trouble. Simple ones can be converted with the Upsizing Wizard, but the more complex ones will have to be rewritten in SQL.
Also note SQL Server objects follow different naming conventions. An Access table is typically prefixed with tbl, SQL tables typically aren't named with a prefix.

How Do You Save An Image Out of a SQL Database Into the File System Using only SQL?

Similar to this question only the other way of flow.
Insert Picture into SQL Server 2005 Image Field using only SQL
I need to be able to save a image field out into the file system and be able to name the file with only using SQL. I don't want to use TEXTCOPY either because I need to use the connection to the database that is running the query itself.
I'd like this to work in SQL 2005 to support older database clients but if it's available in only 2008 that's fine.
Any ideas?
With SQL 2k8 there is the new FILESTREAM type that covers such cases. Filestreams can be opened via the Win32 file access handle like any other file, but hey are integrated into the database from transaction and backup/restore point of view.
I had a similar issue in SQL 2k5 and my solution was to use a CLR stored procedure with EXTERNAL_ACCESS that was writing into the file system using C# file operations.
I don't believe there is a way to save out using only sql, but there is a command-line utility, bcp.

Automatically Generate SQL from existing MS Access table

I've just designed a large database by playing around in MS Access. Now that I'm happy with the design, I need to be able to generate this same database (tables, relationships, etc.) from code.
Rather than hand-writing the SQL CREATE statements (which will be long, tedious, and error-prone process), I was wondering whether there was a shortcut. I seem to recall from my limited exposure to MySql that I was able to export an entire database as an SQL statement that can then be run in order to regenerate that database.
Do you know of a way to do this in MS Access, either through the GUI, or programmatically?
I just found and tried out this tool: jet-tool. It seems to work well for Access 2010.
For free for 30 days (then $30) you can give DBWScript a go, looks like its what you are asking for, although not in native Access GUI or programmatically
The quick and dirty, easy, perfectly legitimate way to do this is just copy the .mdb file. Empty out the data if you need to - usually there are static tables that are handy to leave populated, however.
I use a free utility called MDB Viewer Plus (http://www.alexnolan.net/software/mdb_viewer_plus.htm).
Launch it, open your db, then select your table.
On top menu, select "Table > Generate SQL - CREATE".
I don't know what tools you have on your development machine, so this may or may not be helpful.
You can easily transfer your Access database to Microsoft SQL Server using the Upsizing Wizard.
The express edition of SQL Server is available for free > here.
You will also want to get the free Management Studio Express.
Using these free graphical-based tools you can easily generate the SQL statements to re-create the database. You will have the Create statements you are looking for and they will be placed in a text file.
The Bullzip is very good to this. Very simple. See bullzip Access to MySQL for example
It is possible export any tables to SQL or migrate automatically.
Access to MySQL is a small program that will convert Microsoft Access Databases to MySQL.
Wizard interface.
Transfer data directly from one server to another.
Create a dump file.
Select tables to transfer.
Select fields to transfer.
Transfer password protected databases.
Supports both shared security and user-level security.
Optional transfer of indexes.
Optional transfer of records.
Optional transfer of default values in field definitions.
Identifies and transfers auto number field types.
Command line interface.
Easy install, uninstall and upgrade.
The thing that you're mentioning in MySQL is sql dumping. Very useful feature. If you want to migrate the database to mysql, here's a helpful article.
http://www.kitebird.com/articles/access-migrate.html#TOC_4
I have been using for years a tool called database.net from https://fishcodelib.com/Database.htm
I generally use it on client's site as a portable version of SSMS (drop and run), but it can handle a multitude of RDBMSes, including Access.
Connect to your mdb/accdb, right click any table, choose SCRIPT AS, Create, and you're done.
If you right click Tables header, you can select multiple tables to generate, but I think it's a feature of the paid version.
I have no acquaintance with them, just a happy client.
I found an easy way to go:
Export-> ODBC Database
and then retrieve the SQL form there (e.g via pgadmin on postgres)
Compare'Em
http://home.gci.net/~mike-noel/CompareEM-LITE/CompareEM.htm
The free version creates VBA while the $10 pro version gives you DDL statements.