Switching from MySQL to MSSQL for classic asp
Should it - in theory - be possible to just convert a mysql database to mssql without any/w开发者_开发技巧ith minimal code changes in a classic asp website?
It depends completely on the SQL used.
If you have used functionality in one that doesn't exist (or is different) in the other, of course things have to be changed. For instance, if you're using CTEs in SQL Server, AFAIK they're not supported in MySQL.
Yes in theory you don't have to change much code.
What you do have to change?
- All connection strings - if the code is well written the connection string is written once so just change it there otherwise search all code files for the old connection string and change it.
- SQL delimeter: in
MySQL
it's the backtick character as far as I remeber and in SQL Server it's[
and]
characters - you need it to enclose table and field names which have space or are reserved words. - Special functions in SQL which are not standard.... no list, but keep watch for errors caused by such a difference.
one watch out for, as i've just spent the last couple of weeks doing a similar conversion is the zero datetime.
Since mySQL has a 'zero' datetime, Convert Zero Datetime=true;
in the connection string, and MSSQL doesnt, and if you've logic coded around this, you'll need to change it.
精彩评论