Migrating a database from MS SQL to MySql - How time consuming / difficult is it? - sql

A client wants a database converting from MS SQL to MySql.
Personally I wouldn't do this, I prefer MS SQL for larger databases and like the tools available when working with MSSQL.
However I do use MySql on smaller projects. I've never moved a database from one to the other, or made much use of sprocs when using mysql.
Is there a lot of work involved in rewriting the sprocs, considering I have no prior knowledge of the ms sql database itself, so will need to first gain an understanding of what each sproc does.
This isn't a discussion on which to use as that's already been decided by the client for a few reasons.

have you seen this?
I haven't done this before, but I can only assure you mysql is good for big projects, too.

Related

Inserting large amounts of data in to a database, avoiding RBAR

So I am writing software that has to insert thousands of records into a Microsoft Access. Currently I am using an RBAR(row by agonising row) approach with JET. I wrote a question on SO before asking how to speed up the process and was told to use DAO instead of JET as it would be much faster, and to avoid RBAR.
I am now in the situation where I am ready to implement a faster solution however, I have some further questions. Firstly something simple, does anyone know of a good tutorial for DAO syntax in vb.net as I have tried to look for one online but have struggled. Also does anyone know of a library to use instead?
Secondly what is the best way to avoid an RBAR approach to inserting data into a database. I assume that this is using a record set, but I am unsure how to go about implementing one of these, or the SQL query required to insert several rows at once.
Finally I was told before that ms-access was not the best thing to use a it is slow. Does anyone have any suggestions of a different alternative to access? I would need it to be a free commercial license which I know is a stretch. I only use the database as store for the data I don't need any of the user interfacing that access provides. I found a question on SO about this which suggests SQLite, MySQL or FireBird. Does anyone know of the speed of these solutions compared to Access and whether they are still free for commercial use.
So I am basically looking for advice for how to read/write large amounts of data to a database as quickly as possible. Any help or suggestions would be greatly appreciated.
Bulk inserts using MS SQL Express (free edition):
http://www.sswug.org/articles/viewarticle.aspx?id=35680
Basically involves using the bulk insert syntax and passing in a file:
BULK INSERT Test..Clients FROM
'c:\TestData.csv'
WITH (
FIELDTERMINATOR = ',',
ROWTERMINATOR = '\n'
)
Instead of access, take a look at firebird
Its free and very reliable.
Firebird is a relational database offering many ANSI SQL standard
features that runs on Linux, Windows, and a variety of Unix platforms.
Firebird offers excellent concurrency, high performance, and powerful
language support for stored procedures and triggers. It has been used
in production systems, under a variety of names, since 1981.
The Firebird Project is a commercially independent project of C and
C++ programmers, technical advisors and supporters developing and
enhancing a multi-platform relational database management system based
on the source code released by Inprise Corp (now known as Borland
Software Corp) on 25 July, 2000.

Replace SQLite with SQL Server?

Does anyone know if it's good solution to use SQLite in multi-thread environment.
I want to replace SQL Server with more simple and built-in database as there is no need to feed such big server DB. The supposed max size of DB would be 4 gigabyte after 4-5 years of usage. Is it normal for built-in DB? Could it affect performance?
It depends on the type of queries you would use. If the queries are simple selects with plain joins, then SQLite could do fine but I think you would still be better off with e. g. Firebird 2.5 when the stable release gets out (RC3 is available now). You would have somewhat richer SQL to work with. I don't know how much bulk loads are important for you, but neither SQLite nor Firebird are very strong in this area. If you need good bulk insert performance and low cost, then you should look at PostgreSQL or MySQL. There is also a very interesting looking database I happened to stumble upon recently called CUBRID. I have only installed it so far, so I can't tell how good or bad it is but it certainly seems worth a look.
You might also want to look at this wikipedia article:
http://en.wikipedia.org/wiki/Comparison_of_relational_database_management_systems
I don't know which distro you're talking about here. I've only used SQLite.NET and I know it works well on multithreaded applications.
It can also be deployed on client-server systems so you need not worry at all.
Considering Vinko's statement of 'real' databases, you can ignore him. SQLite is really worth it's salt.
If you're working with .NET, you might find this link useful:
http://sqlite.phxsoftware.com
According to the documentation SQLite is thread safe but there are caveats.
You can use SQLite in a multithreaded environment, but if and only if you build a special version of it (and find out if the library you'll be using it supports it and tweak it if it doesn't.) So, assuming your library supports multithreaded SQLite, if you really need a high level of concurrency to the database you may prefer to use a 'real' database. Be it MSSQL or any other falls out of the scope of the question.
Consider MySQL and SQL Server Express, for example.
If your concurrency level is low, SQLite can cope with it.
I would also suggest you to take a look at the CUBRID database. It has nice optimizations for Web applications and it is easy to learn.

converting stored procedures from sql server to oracle

We have a massive amount of stored procedures to convert from sql-server 2000 to oracle 10g. Does anyone know of any tool that would achieve this?
We used Oracle SQL developer for this but it seems like it is creating extra cursors for each IF/ELSE condition that was on sql server side.
Has anyone successfully used a tool that would do this?
Sorry, no answer, and you have my sympathies. I've been through this before and it was all manual. We ended up making distinct migration & test plan tasks for it.
Oracle will use cursors in places that look odd for people used to SQL server. I am not aware of any (simple) way around this.
There seem to be a number of companies out there now offering services or tools to help: This Google search shows a bunch.
Don't forget to plan for functional equivalence testing. Datatype differences may cause issues, and your application development tool(s) may interact differently with Oracle than they do with SQL server. I did this conversion a number of years ago for a PowerBuilder application, and a lot more of that needed updating than we expected.

Powerful tools for creating SQL queries

I'm looking for a tool, which would help creating complex SQL queries. Sometimes it's difficult to even verify, whether the results of a query are correct. It's especially easy to get queries joining several tables to return too little or too much data.
The tool should enable at least creation of test tables, some kind of visualization how the queries gather their data and hopefully give better parsing of error cases than for example Oracle does.
Are there tools like this or do I have to stick with creating test tables manually, filling them with test data and commiting all kinds of queries with SQuirrel SQL?
When you have a very complex query it is usually easiest to validate by breaking it up into multiple queries that populate temp tables. These intermediary results can be individually verified and then you bring them together to produce the final result set. Depending on performance needs you can stick with the temp table approach or you can then rewrite to a single statement. Typically when I have a huge query it is for background processing so I stick with the temp table approach.
What RDBMS are you using? All of the major ones have some type of console available (e.g.-SSMS in SQL Server, Toad in Oracle, MySQL Query Browser/Administrator for MySQL, etc.), and they all have Query Execution Plans where you can see how the query will actually run. So, the answer to your question is that it's entirely dependent on what RDBMS you're using, but the safe bet answer is: Yes.
I recommend trying SQL Server 2008 Management Studio Express (SSMSE) if you are working with SQL Server. I have used it at work and I believe it does everything you are looking for.
You can get it and SQL Server (express editions) here.
Certainly not a free, open-source solution, but I believe Quest Software's TOAD will fit your requirements. Quest seems to offer alot of tools in that space...they have tools for modeling and analysis, however I've never used the modeler or analyzer.
I personally have experience with the commercial version of TOAD for Oracle. It's GUI is overwhelming at first, but after you mentally filter out all of the extra buttons that you'll never use, it's manageable.

MySQL versus SQL Server Express

Did the recent purchase of MySQL by Sun and the subsequent buggy releases kill the MySQL brand?
I whole heartedly embraced MySQL when it first came out as I used to be a poor developer and all the RDBMs were too expensive. I have fond feelings for MySQL and their being able to compete with Oracle and SQL Server. I credit the original MySQL team for the existence SQL Server Express. I now use SQL Server Express instead of MySQL for just about everything. First, I do not like Sun and second, SQL Server Express is significantly more robust and 'Enterprise' than MySQL.
The only significant limitations on SQL Server Express are the 4GB db size and the lack of Agent. I find that the size limit is not a concern because by the time the db gets close to that size, the application should either be profitable (and you buy the license), or you should kill the product. The Agent issue is a nice to have, but not critical as you can work around it.
It seems that for db simpletons like me, SQL Server Express is easier to setup and use and is faster and more stable. And for gurus, they will use PostgresSQL...
Resolved:
So basically, we have a bunch of SQL Server fans (albeit open-minded) on stackoverflow. It looks like I'm in the right place. It's sad to see MySQL transform from something you cheer to something you pity. I hope the founders of the original company try a new endeavor. I absolutely do not judge them for selling to SUNW - work is naturally profit driven. I hope we get some people with FU money who don't care about profits who create some products like MySQL used to be. Othewise, MSFT might take away EXPRESS.
Having worked with both, I have to say that the limitations and/or bugs in MySQL were a big turn off for me... I don't like PHP, and while I respect the open source community for their advances with these two technologies I just can't see the elegance in the way either of them have been put together. But don't let my personal taste sway your judgement against MySQL.
I do all of my prototyping in SQL Server Express and most of my clients use full blown SQL Server 2005. The ease of transition from one to the other makes it a no brainer for me - I can take anything I wrote for SQL Server Express and put it straight in without worrying that the syntax might be different. The two limitations don't even really get in the way in a dev environment - it's only when you come to production that they would tend to be a problem.
For me, SQL Server wins the argument hands down.
So far no-one knows what Oracle is going to do to MySQL, not even Oracle.
I've done extensive testing of MySQL and would say that in terms of performance it is about at SQL Server 7.0 level. That is fine if all you need is the performance of SQL Server 7.0
At the enterprise level is simply doesn't compete. If you look at the fanfare surrounding MySQL 5.4 it says "now supports more than 4 processors".
Where MySQL scores highly is that it is so cheap that it makes a scale-out design feasible, in which case the raw power of an individual box simply doesn't matter.
There are quite a few ommissions in MySQL that will trap a SQL Server developer. No CHECK constraints, no index views, no separation of clustered indexes from primary keys. That said, it has a large number of useful features that are very useful to web developers.
The Sun/MySQL guys are remarkably honest about their product. They say exactly what the strengths and weaknesses are. If you are used to some of the big vendors sales tactics this comes as a massive shock. Ultimately this does inspire confidence in using the product because you know exactly what to expect. I would much sooner deal with a product that says "don't do this because this is beyond our limits" than one that says "our product is the cure for cancer" and it turns out it couldn't cure a simple hangover!
Having run both*, I don't think there's much question that SQL Server is overall a more full-featured product than MySQL (although I'd be interested to hear arguments to the contrary).
I wouldn't be overly concerned with MySQL bugs - just run a few releases behind.
Given that you have a Windows server, the only issue I can see is the prospect of acquiring a significant cost if you max out the resources permitted with Express and need to go to a full, licensed SQL Server 2005 (or 2008) instance. If you expect to scale to that level and can't afford the licence, then a free DBMS would seem to be the smart move now, and I'd also look at PostgreSQL, which may be a better alternative.
* and liked them both for different reasons, FWIW
This is a very old article. With MySQL 5.7.20 now, there is no reason to use MS SQL Server or any other commercial licensed database. We switched to MySQL for our high profile financial .Net app six months ago after getting tired with over $50K licensing cost for MS SQL server and this was the best decision ever. No licensing cost and MySQL is highly configurable, small foot print, performance better than MS SQL servers. So far no glitches, no issues. Replication is easy to setup and works like a charm. Did I mention, no money even when running on a 32 core server and having five replication server. MS SQL server costs $3000 per two core (in our setup this would come out to be in six figures). Pure stupidity to throw that money out for nothing. Our own benchmarks, MySQL is performing better than MS SQL server. We really like easily configurable events in MySQL in addition to it being free. Just one another point, it takes only a few minutes to install MySQL while it takes forever to install MS SQL server on a new computer. Don't know what MS SQL server needs to do for hours while MySQL zip file can be unzipped and two line command can configure it within minutes.
MySQL is still going strong, and will continue to.
Note however that SQL Server Express is limited in other ways; specifically, number of CPUs and limitation of RAM usage (1 GB).
Personally I prefer SQL Server over MySQL. It is much easier to work with. And applications properly developed for it can scale to enterprise level if you are careful.
I don't think that you liking Sun or the mySQL 'brand' should influence your choices too much - unless you feel mySQL will be run into the ground by Sun. Look at the performance, management and features.
SQL Express with advanced features looks interesting - now has reporting services. SQL Express also requires a windows license and any associated licensing you might need.
mysql could use http://jasperforge.org/ for reporting.
I like writing tsql more, but for any independent projects, I would likely use mysql due to its cost savings that could be passed on to the client - putting me above the competition. People like saving money, even if it is profit.