gpt4 book ai didi

mysql - 从 Ubuntu 机器将 SQLDump 导入到 SQL Server

转载 作者:行者123 更新时间:2023-11-29 20:50:56 28 4
gpt4 key购买 nike

我遇到一种情况,我们当前的 MySQL 数据库需要迁移到 SQL Server。出于测试目的,我在 AWS 上创建了一个 RDS 实例 (SQL Server),并且使用 isql 通过命令行与其建立的连接运行良好。不过,我还通过 phpmyadmin 在 MSSQL 兼容模式下导出了整个 MySQL 数据库,并尝试将其导入到上面创建的 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 来说相对较新,我们将不胜感激!

最佳答案

尝试使用单引号而不是双引号

编辑 - 忽略

关于mysql - 从 Ubuntu 机器将 SQLDump 导入到 SQL Server,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38067069/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com