MySql emulation running on Microsoft SQL 2008 - mysql

We have an application that cannot be altered. The only configuration changes permitted on the application are : host ip, username and password.
The application streams data into a MySql database. Another application then sends this data onto a Microsoft SQL 2008 server.
I would like to remove this middle step and wondered if anyone knew of a way that Microsoft SQL Server 2008 could be configured to 'pretend' to be a MySql database?
Your help is very much appreciated.

Why 'send' the data to the SQL Server when you can just create a linked server?

It cannot be done. MySql and MSSQL are 2 completely different products with different connectionprotocols, a different SQL dialect, different behaviour at times and so on.
I'm sorry.

Related

How to connect Azure Database for MySQL flexible server in Azure SQL Server Database

I am trying to set up a connection between Azure MySQL flexible server and Azure SQL database mainly to read data from MySQL and store it in the SQL Server periodically (multiple times a day).
I was thinking of creating a stored procedure inside my SQL Server database; however, I cannot seem to get a connection from the SQL Server into the MySQL database.
I know with ODBC you can connect MySQL to on-prem SQL Server, but unfortunately, there is nothing I have found for the same functionality for Azure SQL Server.
Has anyone done this? Is this possible?
I have tried to set up an ODBC connection, but it did not work as the SQL Server is on Azure.
I tried setting up a linked server inside SQL Server straight to MySQL, but it doesn't seem possible as the SQL Server is not on-prem.
I tried creating external database objects based on the following link.
With all these approaches, my expectation was to surface the MySQL tables from Azure SQL Server/SSMS.
Thank you for your help in advance!
MySql Workbench is the perfect option for connecting the azure database for mysql.
for that we need to create flexible server in azure portal. I created flexible server in azure portal.
Image for reference:
I created database in flexible server by clicking add in in database option. it crated successfully.
Image for refence:
I installed MySQL Workbench in my local system.
you can get your required fields to connect the server in connect tab.
Image for reference:
I connected to the server by filling required fields.
Image for reference:
Click on ok. It connected successfully.
Image for reference:
AFAIK Export the data from Azure mysql flexible server in the form of sql script through MySQL work bench and import that file in Azure sql database through SSMS. IN this we can write data into Azure Sql database.
I have had to create an Azure Function App that contains a Timer function that reads the data from the MySQL data and pushes it to SQL Server every 15 minutes (as were the requirements).
Thank you for everyone for commenting.
It seems you can use Data-in replication.

SSMS - Linked Servers - Azure

I am hoping someone might be able to assist me with this. We have recently got an Azure SQL server setup and we have an existing externally hosted MySQL server
I am looking for a way to link these to allow SSMS to query against the MySQL database, which I believe can be done using a linked server in SSMS. The issue is that my SSMS seems to not have the options I would expect existing SSMS Options like Server Objects and linked servers
Does anyone know why this isn't visible, I heard it was due to this being an Azure server and not a hosted SQL server
Any ideas?
Gratitude in advance
I am looking for a way to link these to allow SSMS to query against the MySQL database, which I believe can be done using a linked server in SSMS. The issue is that my SSMS seems to not have the options I would expect existing SSMS Options like Server Objects and linked servers
You cannot.
Azure SQL does not supported Linked Servers. Only on-prem SQL Server and Azure SQL Managed Instance supports that.
https://learn.microsoft.com/en-us/sql/relational-databases/linked-servers/create-linked-servers-sql-server-database-engine?view=sql-server-ver15
However you can use OPENROWSET to query any OLE-DB data-source from Azure SQL but this is not the same as a Linked Server.

SSIS linked to a mySQL server

in SQL server it's possible to link a mySQL server into msSQL and query it using SSMS for example. I want to try this and use SSIS to do some transformations and store all the data on this mySQL database.
\I read that there a several ways to link to mySQL into the msSQL server. OLE DB, mySQL ODBC etc etc.
2 questions:
Are there any limitations i might run into when i will use a combination of SSIS and mySQL instead of msSQL?
When i link a mySQL database into msSQL and i write a query in SSMS, do i write the queries in mySQL language or msSQL language. For example the difference in TOP and LIMIT
I have worked with a linked MySQL Server from SQL Server in the past and ran into some issues.
Querying MySQL from SSMS (SQL Server)
Once you have created a linked server you would imagine you should be able to use the four-part name and query the tables in MySQL but it doesnt allow you. for example you cannot do something like...
Select * from MySqlServer.DbName.Schema.TableName
For some reason it throws an error. So the question whether I can use T-SQL in SSMS to query a Linked MySQL Server? Nope, unfortunately not.
But alternatively Microsoft recommends using OPENQUERY to execute queries to a linked server.
When using OPENQUERY, SQL Server does not try to parse the query, it just sends it to the linked server as it is. which means you can/should be able to write MySQL in SSMS using OPENQUERY and it will work.
Using SSIS with MySQL
Even though SSIS is Microsoft's tool that comes with SQL Server but it is a proper ETL tool which can read data from multiple sources and send data to many types of destination.
Once you have used the appropriate driver to connect to MySQL and ported data in SSIS package , its really not relevant anymore, where the data came from? you would have access to all the SSIS tools and you should be able to use them as if the data was coming from a flat file, SQL Server or Excel sheet etc.
By using Linked Server in MSSQL you can also connect to mySql. for that you need to download ODBC drivers. and then you have to create new dsn and while creating dsn you have to insert mySql server's details. then you can further search regarding how to create Linked server on SQL SERVER. This option is very easy and Totally free. You can use OPEN QUERY FOR inserting, updating, deleting and also get the data out from mySQL.

Is it possible to Connecting MYsql with sql server?

I am using an open source software which support mysql and i create application that uses asp.net 4.0 and sql server 2008....
Is it possible to Connecting MYsql with sql server ?
I want every insertion and updating should be made to both database servers as they have same schema of tables but one is mysql and other is sql server 2008 ?
kindly explain step by step if possible
hope this will help,this shows step by step connection
http://www.codeproject.com/Articles/29106/Migrate-MySQL-to-Microsoft-SQL-Server
You can use linked server in MS SQL Server.
From the documentation - A linked server allows for access to distributed, heterogeneous queries against OLE DB data sources.
Have a look at sp_addlinkedserver function.

SQL Server 2008 - moving data from SQL Server 2000

Our company is getting ready to move next week and we currently use SQL Server 2000 for all our databases, hosted in our own building. They've decided to move the data to a local company for several reasons, but they are running SQL Server 2008.
I'd like advice on a few things:
We are trying to setup a test for just a few of our databases to see what breaks with our apps (connection strings, etc.). What is the best way to get a database from our SQL Server 2000 box to the new box without losing data or having to recreate the table, etc. I tried the DB Copy Wizard but restrictions within our network don't allow it. If I create a DB on SQL Server 2008 and perform a RESTORE from the SQL Server 2000 .bak file, I will lose all the transactions, correct? What if I replace the transaction files later? I'm thinking that won't work though.
How to properly upgrade a SQL Server 2000 database to SQL Server 2008? I've run the wizard against most of our databases and it came up clean with the exception of a few minor issues that I can resolve.
Our SQL Server 2000 is our production server so it can't go down at any point to copy files.... not until the move. Our customers have been notified that there will be a short outage period between certain dates so that's ok, but I guess what I'm saying is I can't stop the SQL Server Agent right now just to copy log files and such for testing purposes.
Any help/advice is greatly appreciated!
Create a database backup of the SQL Server 2000 and restore it to the SQL Server 2008.
Setup replication making the SQL Server 2000 as the Publisher and the SQL Server 2008 as the Subscriber.
Not sure which would be the best approach. I think a DB backup and restore would be a good idea. You will loose some data in the mean time, though.
If you were migrating between 2 versions of 2005 or 2008 I would advise a log backup to reduce the data lost but I don't think that this option is available on 2000
One piece of advice I can give you is to take a look at the discontinued features from 2000 and 2005 and from 2005 and 2008 on these links:
2005
2008
Just back up 2000, and then restore it. You won't lose transactions, no difefrent to doing a full backup on your current server.
You'll need to add any SQl logins and set the permissions etc.
You'll need to to do fix users for them as well.
If you only use integrated access then you don't need to.
e.g.
Use MyDataBase
EXEC sp_change_users_login Auto_Fix, 'MyUser'
And you'll need to set the compatibility level
Use
exec sp_bcp_dbcmptlevel 'model'
to get it
and then
EXEC sp_dbcmptlevel 'MyDatabase', ??
to set it.
Another option, would be to install 2000 on your new machine restore a back from the old one and then do an inplace upgrade through the 2008 installation wizard. That sort of thing tends to give my sphincters palpitations though.