SQL Server - Migration from MYSQL to SQL Server 2008

Asked By Pradeep kumar on 25-Nov-11 02:20 AM
Hi,

I am using following statement in SQL Server2008 but this statement is giving error "Incorrect syntax near 'EXIT'.Expecting VARIABLE, ID, or QUOTED_ID"

DECLARE EXIT HANDLER FOR SQLEXCEPTION 

I am using following code in my SP for EXIT handler.

AS


BEGIN

DECLARE EXIT HANDLER FOR SQLEXCEPTION

BEGIN


SET @lngErrNum = -999;


SET @vchrMessage = 'SQLERROR: SQLException encountered';


END



Please help

Reena Jain replied to Pradeep kumar on 25-Nov-11 02:23 AM
hi,

I think you can't do that in normal way taking backup and put that backup in sql server, both database are not compactable, so for that you need convert /migrate mysql database to sql database. refer this for how to convert my sql database to sql database
http://learn.iis.net/page.aspx/759/migrate-from-mysql-to-sql-server-2008/
or
http://download.microsoft.com/download/7/C/2/7C20B070-BFF8-44B4-BD7D-1B03DF50F924/MigrateMySQLtoSQLServer2008.docx
Jitendra Faye replied to Pradeep kumar on 25-Nov-11 03:25 AM
For migration folloe this link-

http://www.codeproject.com/KB/database/migrate-mysql-to-mssql.aspx
Riley K replied to Pradeep kumar on 25-Nov-11 04:07 AM

You are trying to execute the MYSQL Sp in SQL server,

For that reason it is throwing error coz Exit handler does not work in SQL Server


Refer this for exception handling

http://

Regards