首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >从Ubuntu机器导入SQLDump到SQL Server

从Ubuntu机器导入SQLDump到SQL Server
EN

Stack Overflow用户
提问于 2016-06-28 12:27:38
回答 1查看 57关注 0票数 0

我有一个情况,我们当前在MySQL中的数据库需要迁移到SQL Server。出于测试目的,我在AWS上创建了一个RDS实例(SQL Server),并使用isql通过命令行连接到它。但是,我还在MSSQL兼容模式下通过phpmyadmin导出了整个MySQL DB,并尝试将其导入到上面创建的SQL Server中。每当我运行这个命令时-

代码语言:javascript
复制
isql -v MSSQL user 'password' db_name < path_to_sql

我得到了这个错误-

代码语言:javascript
复制
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文件中的一个片段

代码语言:javascript
复制
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相对较新,如果有任何帮助,我们将不胜感激!

EN

回答 1

Stack Overflow用户

发布于 2016-06-28 13:43:11

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

编辑-忽略

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/38067069

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档