Home » SQL Server

Migração em massa SQL Server para MySQL

Olá, alguém conhece algum ETL free que converta de SQL Server para MySQL?



I want ETL free, for converter SQL Server to MySQL.





1 Answer Found


Answer 1


Could you please elaborate a bit? Do you want to convert the SQL Server database to a MySQL database? If so, we can use the SQL Server Import and Export Wizard, it provides the simplest method of copying data between data sources. Please see:

How to: Run the SQL Server Import and Export Wizard

Besides, this is SQL Server Data Access forum, if you want to use the third-party software, you can ask your question in the third-party software forum.



Ai-Hua Qiu



INSERT into openquery(dbserver1MySQL,'select * from graham.lookup_in_table')
select * from NavteqAPAC.dbo.Admin_Names


is giving me the following error! Please help me


OLE DB provider "MSDASQL" for linked server "dbserver1MySQL" returned message "[MySQL][ODBC 5.1 Driver][mysqld-5.1.49-community]Commands out of sync; you can't run this command now".
Msg 7343, Level 16, State 2, Line 1
The OLE DB provider "MSDASQL" for linked server "dbserver1MySQL" could not INSERT INTO table "[MSDASQL]".


I'm new to SQL Server and I'm trying to import data from an XML file into a database that I've created. The database has a number of tables, and some of these tables have foreign keys which reference primary keys in different tables in order to represent one-to-many relationships; however, the XML file is just parsed into a a series of dictionaries consisting of element/value pairs with redundant data.

When I am reading in the XML file and inserting the data into the relevant tables, it is expected that numerous dictionaries may contain the same foreign key value for some of the tables. Since the primary keys of the tables they reference are unique, trying to insert entries which already exist in the referenced table will cause a duplicate entry error.

MySQL has an elegant way of getting around this by having something like:

INSERT IGNORE INTO MyTable (Column1, Column2) VALUES ('Value1' , 'Value2')

This prevents duplicate entries being added to the table. However, this is not a valid command in SQL Server.

I've tried googling for a solution, however the only examples I could find were select entries from one table and inserting them into another, using a select statement and not in clause. What is the best way to insert given values into a table using SQL Server, such that duplicate values will be ignored?


Hi people.

I found article about replicating MS SQL 2000 data and MySQL.

Here is link:     http://blogs.techrepublic.com.com/howdoi/?p=112

I somehow forced them to work :-) but now I have 'Invalid cursor state' error.

Can anyone explain this part here:

"Simply create the MySQL system as a linked server (using the Microsoft OLE DB Provider for ODBC Drivers and the DSN you created). Then, create a replication alert for this error that will run a distributed transaction to the MySQL server instructing it to drop the table MSRepl7 and then restarting the distribution agent. This quick and simple fix will work wonders for your replication stability."

I created MySQL system as a linked server but dont know bold part.



Microsoft announced today the release of first version of SQL Server Migration Assistant (SSMA) for MySQL!  Along with this release, Microsoft refreshed the existing SSMA family of products for Oracle, Sybase and Access with the latest v4.2 release.


SQL Server Migration Assistant for MySQL is the newest migration toolkit, others include Oracle, Sybase, Access, and an analyzer for PowerBuilder. The toolkits were designed to tackle the complex manual process customer’s deal with when migrating databases. In using the SQL Server Migration Assistants, customers and partners reduce the manual effort; as a result the time, cost and risks associated with migrating are significantly reduced.  Our recent SSMA survey showed that 94% of SSMA downloader’s would recommend the tool to others. All SSMA toolkits are available for free download.


Since the SQL Server Migration Assistants for Oracle became available in June of 2005, Microsoft has seen more than a 250,000 downloads across all of the SSMAs. US Department of Defense, Aon, AIM Healthcare, Motorola, Simon & Schuster, Sony Ericsson and Artesia are just a few of the customers that have downloaded and used the SQL Server Migration Assistant toolkit to migrate to Microsoft SQL Server.


With this wave of release, customers can migrate to any edition of SQL Server 2008 R2, SQL Server 2008 or SQL Server 2005. Brand NEW with this release, SSMA for MySQL and SSMA for Access products also support simple and direct migration to SQL Azure.


The latest SQL Server Migration Assistant is available for free download and preview at:

1.       SSMA for MySQL v1.0, out of the two downloads, ‘SSMA 2008 for MySQL’ enables migration to SQL Azure

2.       SSMA for Access v4.2 out of the two downloads, ‘SSMA 2008 for Access’ enables migration to SQL Azure

3.       SSMA for Oracle v4.2

4.       SSMA for Sybase v4.2

Customers and partners can provide feedback via ssmateam@microsoft.com.

SSMA for MySQL v1.0 is designed to work with MySQL 4.1 and above. Some of the salient features included in this release are the ability to convert/migrate:

·         Tables

·         Views

·         Stored procedures

·         Stored functions

·         Triggers

·         Cursors

·         DML statements

·         Control statements

·         Transactions


The latest SSMA v4.2 release for Oracle/Sybase/Access includes:

·         Console support for automated DB assessment/DB migration/SQL syntax conversion for application migration.

·         Support for client side and server side data migration for convenience.

·         Better support for 64-bit platform.

·         Microsoft Access (Access 97 and above) to SQL Azure migration (you can continue to use existing Access front end applications though the data resides in SQL Azure)

·         Support for migrating to SQL Server 2008 R2

·         Support for migrating from latest Oracle (11g R2), Sybase (15.5) and Access (2010) releases



Are there any FREE tools for converting an entire database from MySQL to SQL Server? 


I am trying to store a SQL Server datetime into MySQL datetime field, but MySQL stores the date value as all zeros.  I  use this function to trim the fractional part from the SQL Server datetime, but get the same result when trying to store it in MySQL.

Dim tDate As String = sqlDate.ToString()
        tDate = tDate.Substring(0, tDate.Length - 4)
        Return tDate


Is there any way I can restore a MySQL backup file to MS SQL Server 2005?
I'm using
Windows Server 2008 Small Business 64bits
SQL Server Express 2008
Mysql ODBC Connector 5.1.5 or 5.1.8 for 64 bits

I'm getting the same problem 7303:
Cannot initialize the data source object of OLE DB provider "MSDASQL" for linked server "Mysql".

I reinstall the ODBC connector and sure the name of Data Source is the same i'm using in linked server.

Sql Services Running:
Sql Sever Browser

I need suggestions, thanks.

I'm trying to use SQL Reporting Services to generate some reports from a remote MySQL database. I've installed the MySQL ODBC driver on my machine and can successfully connect. I've also installed and setup SQL reporting services on the same machine.

I can successfully see the reporting services webpage located at http://localhost/Reports

I'm new to SQL Reporting Services - I believe I need to push a 'Report Model' to my reporting server before I can begin to generate reports? This is the part that I'm having trouble with.

How can I create a report model when the data source is a remote MYSQL database? When I try to define a data source in my Report Model project, there doesn't seem to be an option to connect to an MySql server?

Can anyone tell me what I'm doing wrong?


Our DBA quit a few weeks back and I (SQL noob ) have been tasked  with converting  a MySQL database to a SQL Server 2008 database. I used the SSMA MySQL tool. The schema and data migration went well. The only problem I ran into was with two triggers that were set on a table.

So I need to convert the following two triggers from MySQL to T-SQL . I have no clue how to translate these, any help would be greatly appreciated!

delimiter $$

TRIGGER `dbo`.`Trigger1`
BEFORE INSERTON `dbo`.`ContactInfo`
	DECLARE mycompany varchar(100);
	DECLARE mynetwork VARCHAR(100);
	SET spCount = 0;
	selectcount(*) into spCount from ServiceProvider where sp_id = new.sp_id;
	if (spCount = 0 and new.company isnotnull) theninsertinto ServiceProvider (sp_id, company, network) values (new.sp_id, new.company, new.network);

	if (new.company isNULL) thenSELECT company into mycompany FROM ServiceProvider WHERE sp_id = new.sp_id;
		SELECT network INTO mynetwork FROM ServiceProvider WHERE sp_id = new.sp_id;
  if (mycompany isnull) then/* skip it */set mycompany = "none";
		elseset new.company = mycompany;
		IF (mynetwork ISNULL) THEN/* skip it */SET mynetwork = "none";
		ELSESET new.network = mynetwork;

TRIGGER `cstool`.`Trigger2`
AFTERUPDATEON `dbo`.`ContactInfo`
BEGINupdate ServiceProvider set rating = new.rating where sp_id = new.sp_id;




    HHow to connect to the server system in mysql using C# windows application

I have an application which have to use mysql database.I am successfully connect that database using local system and dot net odbc connection. But when I try to connect to the server database it is not possible for me. How configure mysql to connect server database and how to configure windows application to that. (Note: my application should connect to server database from any computer in the internet)

I am using stored procedures in my application using vb.net, while executing stored procedures on mysql database server thru application, the response time from the server is more. Is there any settings that i need to set on mysql db server or any changes in connection string or in code.
Thanks in advance.

I am using stored procedures in my application using vb.net, while executing stored procedures on mysql database server thru application, the response time from the server is more. Is there any settings that i need to set on mysql db server or any changes in connection string or in code.
Thanks in advance.


-- Database: `ebhcemr`
USE ebhcemr;
-- --------------------------------------------------------

-- Table structure for table `addresses`

CREATE TABLE  addresses (
  id int(11) NOT NULL default '0',
  line1 varchar(255) default NULL,
  line2 varchar(255) default NULL,
  city varchar(255) default NULL,
  [state] varchar(35) default NULL,
  zip varchar(10) default NULL,
  plus_four varchar(4) default NULL,
  country varchar(255) default NULL,
  foreign_id int(11) default NULL,
  PRIMARY KEY  (id),
  KEY foreign_id (foreign_id)


I have a cluster server with SQL Server 2000 SP1 Enterprise. This server is distributor and publisher of 2 databases (about 40 subscribers with MSDE 2000 SP4).
I have to change the old server with a new one (Windows Server 2008 Enterprise + SQL Server 2008 Std).
What is the best way to migrate the replication considering that the applications running on subscribers use their local DB and they need to update quickly the data between other subscribers?

Many thanks for your help.



Boa tarde.

Estou com um problema que até julgo simples. mas estou apanhando para fazer no Visual Basic.

Tenho um arquivo de texto, e quero Adicionar um determinado texto sem deletar o anterior.


     No documento, ArquivoTexto.txt, tem o conteudo: "Lendo outros arquivos".

Quero adicionar o texto: "Texto adicionado" para ficar da seguinte forma:

"Lendo outros arquivos

Texto adiconado"


Como faço?


Dear All,

I having problem installing mysql connector/net 6.2.3 on my vsd 2010 because the installed went smoothly but when Im trying to use the mysql on data source provider, I cant see it on the list and when try to install/change the connector the visual studio integreation has an x mark meaning to say it was not installed on my vsd2010.  Thanks.


Novo tópico, novo pedido de ajuda.

Então é assim:
Tenho uma aplicação em excel em que uma das folhas contém resultados originais.
Nas outra folhas estes dados são depois tratados de várias formas, mas estão sempre "ligados" aos originais.

Pretendo proteger estes dados originais para impedir alterações indevidas, (várias pessoas trabalham com a aplicação).
Esta protecção seria accionada só depois de salvar as alterações. A partir deste momento o que está escrito não poderia ser editado. Atenção só ficariam protegidas as células que estão preenchidas, as vazias não, de forma a poder introduzir novos dados.

Sempre que por alguma razão fosse necessário alterar algum dado original seria pedida uma password.

Consegui este código mas está incompleto, protege mas logo após colocar algo nas células e num range. Pretendia para toda a folha e proteger só depois de dar o save.

Assim quando abrir a folha de novo está protegida nas células cheias e posso editar as vazias.

<!-- /* Style Definitions */ p.MsoNormal, li.MsoNormal, div.MsoNormal {mso-style-parent:""; margin:0cm; margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:12.0pt; font-family:"Times New Roman"; mso-fareast-font-family:"Times New Roman"; mso-ansi-language:PT;} p {mso-margin-top-alt:auto; margin-right:0cm; mso-margin-bottom-alt:auto; margin-left:0cm; mso-pagination:widow-orphan; font-size:12.0pt; font-family:"Times New Roman"; mso-fareast-font-family:"Times New Roman";} @page Section1 {size:612.0pt 792.0pt; margin:72.0pt 90.0pt 72.0pt 90.0pt; mso-header-margin:36.0pt; mso-footer-margin:36.0pt; mso-paper-source:0;} div.Section1 {page:Section1;} -->


Private Sub Worksheet_Change(ByVal Target As Range)

Dim ColunasC As Range
Set ColunasC = Range("C2:f20000")
If Not Application.Intersect(ColunasC, Range(Target.Address)) Is Nothing Then
ActiveSheet.Unprotect ("Teste")
Linha = Target.Row
Range("c" & Linha).Locked = True
Range("d" & Linha).Locked = True
Range("e" & Linha).Locked = True
Range("f" & Linha).Locked = True
ActiveSheet.Protect ("Teste"), DrawingObjects:=True, Contents:=True, Scenarios:=True
End If
End Sub

The following code is used to connect C# with mysql server

connectionParam = "SERVER=" + DbServer + ";DATABASE=" + dbName + ";UID=" + uName+ ";PASSWORD=" + pass;

MySqlConnection mConnection = new MySqlConnection(connectionParam );

But what will be the code, if MySql can only be accessed through HTTP Tunneling.

Tunneling URL: http://www.xyzpqr.com/SQLyogTunnel.php (for example)

Olá Galera do MSDN, 

Bom estou com um probleminha facil até de Resolver, porém me falta conhecimento...  Rsrsrs

Acabei de Criar meu Site, porém para que ele ficasse mais apresentavel, gostaria que quando abrisse ele em uma guia, junto do nome na Guia ficasse um Icone, creio que é bem simples mas não consegui achar esta solução.

Gostaria que ficesse neste Exemplo:



Obrigado a Todos vocês...




<< Previous      Next >>

Microsoft   |   Windows   |   Visual Studio   |   Sharepoint   |   Azure