Unable to Import a database from Microsoft SQL Server Management Studio to phpmyadmin - sql

Hey folks, the person I am buildling a website for decided to design their own database. They used Microsoft SQL Server Management Studio to build it and such. Now that they are done with the database they exported it to a text file (Tasks -> Generate Scripts). Now when I try to import the file into phpmyadmin I get the following error:
#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '[master] GO /****** Object: Database [Butterbakers] Script Date: 02/15/201' at line 1
The database code is here: http://zamn.pastebin.com/Y3u7MpZ9

phpmyadmin is for MySQL.
Microsoft SQL Server is a different DBMS.
Large parts of the SQL Syntax is DBMS/vendor specific.
The MySQL Workbench has a feature to "Create EER Model from existing Database".
This may be a try but you need a jdbc connection to the MS SQL Server and MySQL...
Converting DDL to a different DBMS is all but easy. And if you're done this doesn't guarantee that an probably already existing application is still working with the other DBMS.
Not switching DBMS and using the free MS SQL Express could be an option.
First decide for a DBMS and restart form zero is surely the cleanest and less painful solution.

With SQL Compare (http://www.red-gate.com/products/sql-development/sql-compare/) and SQL Data Compare (http://www.red-gate.com/products/sql-development/sql-data-compare/) , you can synchronize different DB.

Related

SCADA reading from MariaDB: Error in Syntax

We have a SCADA System (Intouch). It had a Access .mdb database file on the client PC, which was defined as System DSN (Windows ODBC).
What I'm trying to do is to migrate the whole DB thing to MariaDB, running on remote server. I have already a running server, the connection from the SCADA PC to the server is up an running and it is added as system DSN in ODBC, using the MariaDB ODBC connector. I was also able to export all the data from Access to the Maria database, using Access's native export to ODBC database, so all my data is in Maria.
The Problem: The SCADA cannot read ot white anythig. In the scada's log i get SQL Syntax errors (forgot to mention, that the scada uses SQL). Thanks in advance!
Update:
It's old fashioned WindowMaker application, not Archestra, thus the SQL Functions are used. I've even changed the ODBC connector from Maria to mySQL
Today I've made some logs. Here the error:
"SELECT Checksum, (rest deletet by me.. is too long).... FROM Stp WHERE ProgNr=1and StpNr=0"
[37000] [MySQL][ODBC 8.0(a) Driver][mysqld-5.5.5-10.3.22-MariaDB]
You have an error in your SQL syntax; check the manual that corresponds
to your MariaDB server version for the right syntax to use near 'StpNr=0' at line 1 (1064)
From the review of your update it looks like its just a plain ol' syntax error.
What you provided:
SELECT Checksum, (etc)... FROM Stp WHERE ProgNr=1and StpNr=0
The logs complain of syntax by StpNr=0 but your problem is immediately before that where you haven't put a space between the AND and the ProgNr=1 command.
Correct syntax would be:
SELECT Checksum, (etc)... FROM Stp WHERE ProgNr=1 and StpNr=0
In my personal experience the WindowMaker SQL functions are extremely clunky to work with (especially with the 131 char limit on message tags). You can usually help yourself out by Logging your Query then trying it directly in your database.

How to export database from mysqlworkbench to sql server

I designed a schema in Mysql Workbench, I want to get a script from Mysql Workbench and use it in sql server
I could transfer the database from mysql workbench to sql server using database converter which was very helpful.
I used https://www.spectralcore.com/fullconvert/ to do the conversion

Generate an "INSERT INTO" script from SQL Server to Postgres

I need to generate a script with the data from one db in sql server to postgres. It seems the "Generate Script" in SQL Management doesn't do ANSI format like INSERT INTO that I need.
How can I do it?
I suggest.
Fire up an instance of Postgres on an accessible device.
Set up a linked server from Microsoft SQL Server to access the postgresql server using the postgres 64 bit odbc driver.
Start writing TSQL to transfer the data.
https://www.google.com.au/search?q=postgresql+odbc+sql+server+2012

Transfer database from SQL Server 2008 version 10.50.2500 to 10.0 2531

I cannot believe this is so difficult. Backup / Restore fails. Import and Export both fail with a variety of silly errors.
Is there a way to do this that works?
Try scripting out the schema and data, with the SQL Server Management Studio
Article explaining how to use SQL Server Management Studio
If that doesn't work, you'll have to use a more advanced third party tool. Like, for instance, Red Gate's Sql Toolbelt, where:
SQL Compare allows you to compare and merge schema between 2 databases
Data Compare allows you to compare and merge data between 2 databases

SSIS and MySQL - Table Name Delimiter Issue

I am trying to insert rows into a MySQL database from an Access database using SQL Server 2008 SSIS.
TITLE: Microsoft SQL Server Management Studio
------------------------------
ERROR [42000] [MySQL][ODBC 5.1 Driver][mysqld-5.0.51a-community-nt]You have
an error in your SQL syntax; check the manual that corresponds to your MySQL
server version for the right syntax to use near '"orders"' at line 1
The problem is with the delimiters. I am using the 5.1 ODBC driver, and I can connect to MySql and select a table from the ADO.Net destination data source.
The MySql tables all show up delimited with double-quotes in the SSIS package editor:
"shipto addresses"
Removing the double quotes from the "Use a table or view" text box on the ADO.NET Destination Editor or replacing them with something else does not work if there is a space in the table name.
When SSIS puts the Insert query together, it retains the double quotes and adds single quotes.
The error above is shown when I click on "Preview" in the editor, and a similar error is thrown when I run the package (albeit then from the actual insert statement).
I don't seem to have control over this behavior. Any suggestions? Other package types where I can hand-code the SQL don't have this problem.
Sorry InnerJoin, I had to take the accepted answer away from you. I found a workaround here:
The solution is to reuse the connection for all tasks, and to turn ANSI quotes on for the connection before you do any inserts, with an Execute Sql task that runs the following:
set sql_mode='STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,
NO_ENGINE_SUBSTITUTION,ANSI_QUOTES'
Try using square brackets around the table names. That may help.
EDIT: If you can, I would create views (with no spaces) based on the Access tables, and use those to export. Even if it means building another Access database with linked tables, I think this is your best bet.
I've always struggled with using SSIS with MYSQL directly. Even after installing the ODBC drivers, they just don't play well in data flows. I've always ended up creating linked ODBC connections between SQL Server and MYSQL. I then rely on linked server queries to bring over data. Instead of using a SSIS data flow task, I use an Execute SQL command, usually in the form of a stored procedure that executes an OPENQUERY.
One solution you could do is load the data into a SQL Server database and use it as a staging environment before you load it into the MYSQL database. I regularly move data between SQL Server 2008 and MYSQL and in the past I use to regularly move data between Access and SQL Server.
Another possible solution is to transform the incoming Access data before it loads into the MYSQL database. That may give you a chance to clean up the column names and the actual data that's going through to MYSQL.
Let me know if either of these work for you.
You can locate the configuration setting file my.ini at <<Drive>>:\ProgramData\MySQL\MySQL Server 5.6\my.ini and add "ANSI_QUOTES" to sql-mode.
e.g: sql-mode="STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION,ANSI_QUOTES". This should solve the issue while previewing in the SSIS editor.