MSSQLServer轉MySQL實測

來源:互聯網
上載者:User

標籤:

按計劃今天著手進行將後台資料庫從MS SQL Server2000轉換成MySQL5.1.3。目的是便於發布軟體的測試版本。

  1. 驅動: mysql-connector-odbc-5.1.11-win32.msi。測試Win7*64, XP通過。

  2. MySQL_5.1.3免安裝版。

  3. MSS2SQL工具軟體轉換SQLServer2000的表結構。一共轉換了43個表。

  4. MSSQLServer2000中的預存程序轉換到MySQL。

  //To-Do

  

  5. SQL函數的區別

  (1)select *   from A where convert(nvarchar(10),tMakeDate,121)>=‘2015-05-08‘

  -> SELECT * from A WHERE DATE_FORMAT(tMakeDate, ‘%Y-%m-%d‘)>=‘2015-05-08‘

  (2)select * from A where isnull(cMaker, ‘‘)<>‘‘

  -> SELECT * from Awhere IFNULL(cAuditMan,‘‘)<>‘‘

  (3)select newid()

  ->SELECT UUID()

    select getdate()

  ->SELECT NOW()

  (4)update a set a.欄位1=b.欄位2 from 表A  a, 表B  b where a.MID=‘1‘

  ->update 表A  a, 表B  b set a.欄位1=b.欄位2 where a.MID=‘1‘

  (5)select top 10 * from A

  -> select * from A LIMIT 10

  (6)select convert(nvarchar(10),getdate(),121) as Date1, convert(nvarchar(10),getdate()-2,121) as Date2

  ->SELECT DATE_FORMAT(NOW(),‘%Y-%m-%d‘) as Date1, DATE_FORMAT(DATE_SUB(NOW(), INTERVAL 2 DAY), ‘%Y-%m-%d‘) as Date2

  (7)insert into A(MID,iType) select newid(), 1 where not exists(select 1 from A where iType=1)

  ->INSERT INTO A(MID, iType) SELECT UUID(), 1 FROM DUAL WHERE NOT EXISTS (SELECT 1 FROM A WHERE iType=1)

  Dual虛擬表

  6. 設定MYSQL為UTF8編碼

  修改my.ini設定檔,參考:http://blog.csdn.net/red4711/article/details/6007248

  7. MYSQL中不支援匿名塊,也就是說過程性語句IF,THEN必須放在預存程序中執行。

MSSQLServer轉MySQL實測

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.