0

I have a situation wherein our current DB, in MySQL needs to be migrated to SQL Server. For testing purposes, I have a created an RDS instance (SQL Server) on AWS and the connection to it via command line using isql works well. However I have also exported the entire MySQL DB via phpmyadmin in MSSQL compatibility mode and trying to import the same to the SQL Server created above. Whenever I run this command -

isql -v MSSQL user 'password' db_name < path_to_sql

I get this error -

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

The following is a snippet from my sql file for one of the tables

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'
);

Relatively new to SQL Server, any help will be appreciated!

Navin Nagpal
  • 612
  • 10
  • 23

1 Answers1

0

Try using single quotes rather than double quotes

Edit - disregard

Eric
  • 643
  • 4
  • 17