sql server - Incorrect syntax when import sql file from MySQL to MS SQL via SQLCMD -
i have large .sql files exported mysql, , try import them ms sql(localdb) via
sqlcmd. when type in following command-prompt:
sqlcmd.exe -s (localdb)\mssqllocaldb -i c:\users\administrator\desktop\1\sqlquery4.sql
i got following error message:
incorrect syntax near 'tblo'
i checked .sql file, seems sqlcmd can't understand double quotes
e.g.
insert "tblo" values (2,'dtt','10000286','dp','y',2,38,'2010-02-22 11:03:51','2010-02-22 11:03:51');
however, it's fine ssms
any idea solve problem?
i found solution myself: can add --skip-quote-names flag when dump data mysql
e.g.
mysqldump.exe -hlocalhost -uusername -ppassword --compatible=mssql --no-create-info --skip-quote-names --skip-add-locks database tblo > d:\test\dump.sql
result in dump.sql like:
insert tblo values (2,'dtt','10000286','dp','y',2,38,'2010-02-22 11:03:51','2010-02-22 11:03:51');
so can use .sql directly import data ms sql server via sqlcmd
sqlcmd -s (localdb)\mssqllocaldb -i d:\test\dump.sql
Comments
Post a Comment