in reply to Re: CGI MySQL script to ASP(perlscript) MSSQL
in thread CGI MySQL script to ASP(perlscript) MSSQL

All of the DBI things like $sth->fetchrow_hashref etc. should work identically with the possible exception of the case of the column names (I forget if there is a difference, but if there is, it can be solved by using the FetchHashKeyName attribute).

As another poster mentioned, there will be some differences in datatypes. I don't know if MS-SQL supports MySQL extensions like the LIMIT clause. In terms of checking for these kinds of differences, I would recommend O'Reilly's _SQL_In_A_Nutshell_ - it's not the best SQL reference, but it does list implementation-specific differences for most commands. You could also try looking at some of the DBI extension modules that work on multiple databases and either use them or look at their code to see trouble spots. I've not used it but Rosetta claims to handle implementation differences. SQL::Translator ought to be useful for converting CREATE statements.

In terms of testing, you can comment out all of your executes and just run the prepares of all your SQL - the prepare will let you know if there are SQL syntax errors without actually doing anything to the database. Better yet, create a dummy database and just run your script and see where problems (if any) crop up.

  • Comment on Re: Re: CGI MySQL script to ASP(perlscript) MSSQL