2016-06-28 11 views
0

Ich habe eine Situation, in der unsere aktuelle DB, in MySQL auf SQL Server migriert werden muss. Zu Testzwecken habe ich eine RDS-Instanz (SQL Server) auf AWS erstellt und die Verbindung dazu über die Kommandozeile mit isql funktioniert gut. Allerdings habe ich auch die gesamte MySQL-DB über phpmyadmin im MSSQL-Kompatibilitätsmodus exportiert und versucht, diese auf den oben erstellten SQL-Server zu importieren. Immer wenn ich diesen Befehl ausführen -Importieren von SQLDump zu SQL Server von Ubuntu Maschine

isql -v MSSQL user 'password' db_name < path_to_sql 

ich diesen Fehler -

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 

Das folgende ist ein Auszug aus der Liste meiner SQL-Datei für eine der Tabellen

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

relativ neu SQL Server, jede Hilfe wird geschätzt!

Antwort

0

Try Apostrophe anstatt doppelte Anführungszeichen

mit

Bearbeiten - Mißachtung

Verwandte Themen