0
我有一種情況,我們當前的數據庫在MySQL中需要遷移到SQL Server。出於測試目的,我在AWS上創建了一個RDS實例(SQL Server),並使用isql通過命令行連接到它。 但是,我還通過phpSQLadmin以MSSQL兼容模式導出了整個MySQL數據庫,並試圖將其導入到上面創建的SQL Server中。 每當我運行此命令 -從Ubuntu機器導入SQLDump到SQL Server
isql -v MSSQL user 'password' db_name < path_to_sql
我得到這個錯誤 -
SQL> CREATE TABLE "access_levels" (
[37000][unixODBC][FreeTDS][SQL Server]Incorrect syntax near 'access_levels'.
[ISQL]ERROR: Could not SQLExecute
SQL> "id" int NOT NULL,
[37000][unixODBC][FreeTDS][SQL Server]Incorrect syntax near 'id'.
[ISQL]ERROR: Could not SQLExecute
SQL> "user_id" int NOT NULL,
[37000][unixODBC][FreeTDS][SQL Server]Incorrect syntax near 'user_id'.
[ISQL]ERROR: Could not SQLExecute
SQL> "brand_id" int NOT NULL,
[37000][unixODBC][FreeTDS][SQL Server]Incorrect syntax near 'brand_id'.
[ISQL]ERROR: Could not SQLExecute
SQL> "outlet_id" int NOT NULL,
[37000][unixODBC][FreeTDS][SQL Server]Incorrect syntax near 'outlet_id'.
[ISQL]ERROR: Could not SQLExecute
SQL> "feature_id" int NOT NULL,
[37000][unixODBC][FreeTDS][SQL Server]Incorrect syntax near 'feature_id'.
[ISQL]ERROR: Could not SQLExecute
SQL> "access" int NOT NULL,
[37000][unixODBC][FreeTDS][SQL Server]Incorrect syntax near 'access'.
[ISQL]ERROR: Could not SQLExecute
SQL> "created_at" timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
[37000][unixODBC][FreeTDS][SQL Server]Incorrect syntax near 'created_at'.
[ISQL]ERROR: Could not SQLExecute
SQL> "updated_at" timestamp NOT NULL DEFAULT '0000-00-00 00:00:00'
[37000][unixODBC][FreeTDS][SQL Server]Incorrect syntax near 'updated_at'.
[ISQL]ERROR: Could not SQLExecute
SQL>);
[37000][unixODBC][FreeTDS][SQL Server]Incorrect syntax near ')'.
[ISQL]ERROR: Could not SQLExecute
以下是從我的SQL文件片段的表
CREATE TABLE "access_levels" (
"id" int NOT NULL,
"user_id" int NOT NULL,
"brand_id" int NOT NULL,
"outlet_id" int NOT NULL,
"feature_id" int NOT NULL,
"access" int NOT NULL,
"created_at" timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
"updated_at" timestamp NOT NULL DEFAULT '0000-00-00 00:00:00'
);
相對較新的一個SQL Server,任何幫助將不勝感激!使用單引號,而不是雙引號