2

I have a backup of an SQL Server DB in .bak format which I've successfully managed to restore to a local instance of SQL Server Express. I now want to export both the structure and data in a format that MySQL will accept. The tools that I use for MySQL management typically allow me to import/export .sql files, but unfortunately Microsoft didn't see fit to make my life this easy!

I can't believe I'm the first to run into this, but Google hasn't been a great deal of help. Has anybody managed this before?

4

1 回答 1

1

将有两个问题:1)数据类型。MS SQL 类型和 MySQL 类型之间并不总是有直接的类比。例如,MySQL 以非常不同的方式处理时间戳,并且当您需要在不同的 n 值处在 varchar(n) 和 varchar(max)/text 之间切换时,它有一个截止点。数值类型也有一些小的差异。

2) 查询语法。查询语法有一些差异,同样,并不总是有 1:1 的模拟替换。我想到的最重要的是MS SQL中的SELECT TOP N * FROM T变成MySQL中的SELECT * FROM T LIMIT N(MySQL使分页加载更容易)。

于 2008-08-26T13:55:32.200 回答