.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Linked Server for MySQL database not working

Posted By:      Posted Date: April 10, 2011    Points: 0   Category :ASP.Net

Dear All,

I have installed MySQL Database on my local PC (WAMPServer 2.1)
I want to update few tables in my SQL Server (2008) Database from MySQL Database.

To achive this I have created a linked server in SQL Server for MySQL Database using System DSN. Now I can query to all tables from linked server for example:


It reterive few rows and then give error message

Msg 0, Level 11, State 0, Line 0
A severe error occurred on the current command. The results, if any, should be discarded.
Msg 0, Level 20, State 0, Line 0
A severe error occurred on the current command. The results, if any, should be discarded.


View Complete Post

More Related Resource Links

insert query from ms SQL server into a mysql linked server

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]".

Problems with MSDASQL when working with linked server from t-sql

Good day. I have a big problem when working with linked server to PostgreSQL from t-sql. ------------------------------------------- Windows Server 2003 SP2 x64 Updating OLE DB-Provider for ODBC WindowsServer2003.WindowsXP-KB948459-v2-x64 SQL Server 2008 R2 Ent x64 (10.50.1734)  x64 ODBC Provider for Postgres ------------------------------------------- Created system dsn on PostgreSQL. Created a linked server using this dsn through MSDASQL provider. Settings MSDASQL provider by default (only Allow inprocess = true). Selects the linked server works fine. If I try to insert a table on a linked server: insert PG_SERVER.BASE.[public].codepost select top 50000 p1, p2, p3, p4, p5 from #qwe then inserting a small number of lines (up to 10000) of the form 'test', 'test', 'test', 'test', 'test'  it works, but more of a script hangs with different wait types (oledb, preemptive_com_release ...) and does not help even kill process, only restart sql server service. How to solve this problem?

restore SQL server 2005 database on new SQL server 2008 not working

please any one advice me ,i have Great Plain database on SQL server 2005 when i tried to install new SQL server 2008 and restore my Database the GreatPlain not working well as well the Data Base

Incremental data load from MySQL database to SQL server 2008 using SSIS


I am looking for best solution to perform incremental data load from MySQL database to SQL Server 2008.  I tried to follow instructions from articles on incremental data load in SSIS  using MD5 hashes but I failed to make connection in Lookup transformation editor between MySQL Id (4 byte unsigned integer) and Id in SQl Server 2008 table which is  bigint. i tried to add  data conversion and convert MySQl Id to string. It works fine when you map this field directly to OLEDB destination but in Lookup component it failed. 


Any input greatly appriciated.



Linked server from SQL Server 2008 R2 to SQL Server 2005 not working


I'm trying to create a linked server from SQL Server r2 to SQL Server 2005 (both 64 bit Enterprise) using the following script

 EXEC master.dbo.sp_addlinkedserver
 @server = N'TestLS'
 ,@provstr='Integrated Security=SSPI;';

I verified that the Kerberos is working.

When I try to run a four part query as below it gives me the error

Msg 18456, Level 14, State 1, Line 1
Login failed for user 'NT AUTHORITY\ANONYMOUS LOGON'.
OLE DB provider "SQLNCLI10" for linked server "TestLS" returned message "Invalid connection string attribute".

If I try to set up the linked server against localhost (i.e. SQL 2008 R2, it works just fine).



Distributed transaction using linked server not working in SQL Server 2008 64 bit


Hi. I have had an issue trying to get distributed transactions to work in SQL Server 2008 using a linked server. The error message I get is

OLE DB provider "SQLNCLI10" for linked server "pod1" returned message "No transaction is active.".
Msg 7391, Level 16, State 2, Line 3
The operation could not be performed because OLE DB provider "SQLNCLI10" for linked server "pod1" was unable to begin a distributed transaction.

My Environment:

Windows Server 2008 Enterprise 64 bit, SQL Server 2008 Enterprise 64 bit

Problem occurs with multiple different builds of SQL Server 2008 - I have been able to reproduce the problem with 10.0.1600.0, 10.0.1779.0 (CU 2), as well as 10.0.2531 (SP1)


I am aware that other people have had this issue and have reviewed all existing posts. I have verified that the MSDTC is configured correctly on both machines. I have also used DTCTester to verify that DTC is working correctly on all machines in question. None of the mentioned resolutions has solved this problem for me.

I am not seeing this problem occur on my 32 bit test machines - it is only occurring if at least one of the two machines is 64 bit.


Linked Server with SQLNCLI and a default database.


I have a linked server from one 2005 server (server A) to another 2005 server (server B). The linked server is created like this:


EXEC sp_addlinkedserver

@server = N'TEST',



Linked Server to Password Protected Access Database


I want to create linked server in SQL 2005 with Ms Access 2003 Database. I have used following commands to create linked server.

EXEC sp_addlinkedserver
@server = N'TestLinkServer',
@provider = N'Microsoft.Jet.OLEDB.4.0',
@srvproduct = N'Access',
@datasrc = N'D:\Test.mdb',
@provstr = Null

EXEC master.dbo.sp_addlinkedsrvlogin

With above command linked server successfully create and can run SQL query against linked server. But if i set Database password to MS Access 2003 Database, then it gives following error message.

The OLE DB provider "Microsoft.Jet.OLEDB.4.0" for linked server "TestLinkServer" reported an error. Authentication failed.

Any ideas?


linked server on SQL 2005 to database on AS400


We have a linked server on SQL 2005 to database on AS400. the linked server is made using Microsoft DB2OLEDB provider.
when we are using the linked server, we are getting the following error:
OLE DB provider "DB2OLEDB" for linked server "AS400PROD" returned message "".
Msg 7303, Level 16, State 1, Line 1
Cannot initialize the data source object of OLE DB provider "DB2OLEDB" for linked server "AS400PROD".
When we restart  the SQL server machine, the linked server works fine for about 5 minutes then we receive the same error as described before,
The script of the linked server is :

EXEC master.dbo.sp_addlinkedserver @server = N'AS400PROD', @srvproduct=N'AS400', @provider=N'DB2OLEDB', @datasrc=N'S6595D7F', @provstr=N'Provider=DB2OLEDB;Password=password;Persist Security Info=True;User;Initial Catalog=S6595D7FSD;Data Source=AS400;Network Address=;Package Collection=KFILFNBSA;DBMS Platform=DB2/AS400;Process Binary as Character=True'
/* For security reasons the linked server remote logins password is changed with ######## */
EXEC master.dbo.sp_addlinkedsrvlogin @rmtsrvname=N'AS400PROD',@useself=N'False',@locallogin=NULL,@rmtuser=N'LOGINRPORT',@rmtpassword='########'

Linked Server Error 7303 for Access 2003 Database

I am having difficulty creating a linked server to and Access 2003 database on my SQL 2005 server.  Whenever I create a linked server through the either the “New Linked Server” tool in the SQL Management Studio or using the sp_addlinkedserver method, receive and error indicating “Cannot initialize the data source object of the OLE DB provider…(Microsoft SQL Server Error: 7303)”.  Although my ultimate goal is to link to a secure Access 2003 database file, the current MDB file I am trying to link to is “unsecured”.  I have already verified that the SQL Service account has read and write access to the folder containing the MDB file as well as the temp directories on the SQL server (suggestions from other forums).  Is there any SQL Server configuration that I need to modify in order to use the Jet 4.0 linked server provider (Microsoft.Jet.OLEDB.4.0)?

Suggestion about exporting data into Access database from sql server 2008 without Linked Server



    We have a website that was using Sql server 2005. There was a option in Website where when a user clicks a button, Some tables data will be exported to an access database. To achieve this, we have setup a linked server to Access database. We have moved from sql server 2005 to 2008 (64bit). We did not want to use that option of having a linked server now. I am looking for different ways to achieve the task. We also donot want to use OPENROWSET and OPENDATASOURCE .


Can someone  give some insight about this?




issue with linked server from sql server 2008 to access 2003 database



I am trying to create a linked server from sql server 2008 to a secure access 2003 database(database which has a password), whatever options i am trying the result is i am getting the error 7399("Cannot start your application. The workgroup information file is missing or opened exclusively by another user.".) or error 7303.

I am selecting 'Microsoft.Jet.Oledb.4.0' as the provider. I think the problem is somewhere in

the workgroup files

Please help me in creating this linked server.



MS SQL Server: Disconnect Users From Database - Kill User Session

If you ever wanted to restore your database from a SQL backup file (.bak), but there are still users connected to your database, the backup operation will fail causing the error: Exclusive access could not be obtained because the database is in use.

Publishing SQL Server Database using Publishing Wizard : Tips & Tricks

We can use SQL Server Publishing Wizard to deploy our local Database to remote hosting server/production server.This feature is available in SQL Server 2008/VWD 2008.

Below is the complete step by step guide of this process.

Connestion string create any database server

This links important to how to create connection string to any data base sever.

SQL Server Database Transaction

A transaction is a group of SQL commands executed together as a single component of work to be accomplished. If all of these commands succeed, then a transaction is committed - the changes to the data are made final. If any of the commands within a transaction fail, then the entire transaction is cancelled, or in SQL Server terms, the transaction will be rolled back.

Transactions are one of the things that keep your data safe, but they're not necessarily easy to understand. Here's some help:

Database Export Wizard for ASP.net and SQL Server

A step wizard for ASP.net to export database objects to CSV, TXT, HTML, XML, or SQL. it guides users through a few simple steps to choose a database object (table, view, or query), select columns, and export the data in any of the standard formats CSV, HTML, XML, or SQL.
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend