3

Is there any way i could make a sql script file compatible with both MYSQL and MSSQL? MYSQL and MSSQL should be able to use that file to execute the SQL scripts contained in the file. The following SQL statement is just an example.

   CREATE TABLE testTable(
   Name VARCHAR(20),
   Address VARCHAR(50),
   Gender VARCHAR(10)
   );

   INSERT INTO testTable
   VALUES
   ('Derp', 'ForeverAlone Street', 'Male'),
   ('Derpina', 'Whiterun Breezehome', 'Female');

   SELECT * FROM testTable;

PS, I heard u could use CSV files. I dont know if its true. I dont see any proper examples online.

EDIT: NO you cant use csv files to execute statements. They are used to dump data. Some sql statements are written differently in MS SQL and MYSQL. Common statements such as Create, select statements are the same in both MS SQL and MY SQL. one of the difference could be LOAD DATA INFILE and BULK INSERT FROM

4

1 に答える 1

1

ansi sql を使用するとほとんどの問題を回避できますが、すべての場合で 100% 相互互換性があるものを使用できるかどうかはわかりません

詳細については、こちらを参照してください: ANSI SQL マニュアル

于 2012-07-24T14:09:35.167 に答える