Query A Linked MySQL Database
Jul 2, 2003
We have SQL Server 2000 on a Windows 2000 server and a mySQL database running on a Windows 2000 server.
We have used MyOLEDB driver(OLEDB) to link the mysql database.
How can I access the data stored in a Linked server?
Any help would be appreciated.
Thanks!!
this is our code¡G
exec sp_addlinkedserver @server='OLEDB_test',
@srvproduct=N'',
@provider=N'MySQLProv',
@datasrc=N'203.xx.xx.xx',
@catalog = N'Store'
exec sp_addlinkedsrvlogin 'OLEDB_test','false',null,'root',''
select * from OLEDB_test.Store.root.Books
or
select * from OLEDB_test.Store..Books
error message:
Can't create OLE DB Provider 'MySQLProv' instance¡C
OLE DB error trace [Non-interface error: CoCreate of DSO for MySQLProv returned 0x80040154]¡C
by the way¡G
1.We Create an ODBC System DSN that points to our MYSql server
2.We use OLEDB for ODBC to create a linked server to mySQL
3.We have got the query to work with openquery
but we can't update¡Bdelete¡Bmodify the data stored in a Linked server
View 1 Replies
ADVERTISEMENT
Feb 25, 2004
Hi,
I've installed MyODBC-3.51.06 and succsesfully created 2 odbc sources to the MySQL database with the ODBC data source administrator. One is a User DSN, the other a system DSN (Q1: what's the difference?) The test in that applet perfoms positively.
Running a dataimport of the tables using the import data option in enterprise manager does work as well.
Now for the part that gives me trouble. I would like to create a linked server using enterprise manager of SQL server 2000 (SQL 8.00.194) but I'm totaly stuck there. So Q2: how to get this set up?
View 2 Replies
View Related
Feb 12, 2007
Good Morning
Has anyone successfully used cherry's oledb provider for MYSQL to create a linked server from MS SQLserver 2005 to a Linux red hat platform running MYSQL.
I can not get it to work.
I've created a UDL which tests fine. it looks like this
[oledb]
; Everything after this line is an OLE DB initstring
Provider=OleMySql.MySqlSource.1;Persist Security Info=False;User ID=testuser;
Data Source=databridge;Location="";Mode=Read;Trace="""""""""""""""""""""""""""""";
Initial Catalog=riverford_rhdx_20060822
Can any on help me convert this to corrrect syntax for sql stored procedure
sp_addlinkedserver
I've tried this below but it does not work I just get an error saying it can not create an instance of OleMySql.MySqlSource.
I used SQL server management studio to create the linked server then just scripted this out below.
I seem to be missing the user ID, but don't know where to put it in.
EXEC master.dbo.sp_addlinkedserver @server = N'DATABRIDGE_OLEDB', @srvproduct=N'mysql', @provider=N'OleMySql.MySqlSource', @datasrc=N'databridge', @catalog=N'riverford_rhdx_20060822'
GO
EXEC master.dbo.sp_serveroption @server=N'DATABRIDGE_OLEDB', @optname=N'collation compatible', @optvalue=N'false'
GO
EXEC master.dbo.sp_serveroption @server=N'DATABRIDGE_OLEDB', @optname=N'data access', @optvalue=N'true'
GO
EXEC master.dbo.sp_serveroption @server=N'DATABRIDGE_OLEDB', @optname=N'dist', @optvalue=N'false'
GO
EXEC master.dbo.sp_serveroption @server=N'DATABRIDGE_OLEDB', @optname=N'pub', @optvalue=N'false'
GO
EXEC master.dbo.sp_serveroption @server=N'DATABRIDGE_OLEDB', @optname=N'rpc', @optvalue=N'false'
GO
EXEC master.dbo.sp_serveroption @server=N'DATABRIDGE_OLEDB', @optname=N'rpc out', @optvalue=N'false'
GO
EXEC master.dbo.sp_serveroption @server=N'DATABRIDGE_OLEDB', @optname=N'sub', @optvalue=N'false'
GO
EXEC master.dbo.sp_serveroption @server=N'DATABRIDGE_OLEDB', @optname=N'connect timeout', @optvalue=N'0'
GO
EXEC master.dbo.sp_serveroption @server=N'DATABRIDGE_OLEDB', @optname=N'collation name', @optvalue=null
GO
EXEC master.dbo.sp_serveroption @server=N'DATABRIDGE_OLEDB', @optname=N'lazy schema validation', @optvalue=N'false'
GO
EXEC master.dbo.sp_serveroption @server=N'DATABRIDGE_OLEDB', @optname=N'query timeout', @optvalue=N'0'
GO
EXEC master.dbo.sp_serveroption @server=N'DATABRIDGE_OLEDB', @optname=N'use remote collation', @optvalue=N'false'
Many Thanks
David Hills
View 7 Replies
View Related
Mar 7, 2001
I have created a linked server to a MySQL database using a DSN. Does anyone know how to run a select statement against a table in the MySQL database? The usual 4 part naming convention does not work.
I can run SELECT *
FROM OPENQUERY(Top50, 'SELECT * FROM orders') which does return records successfully. (Top50 being the name of the linked server)
My objective is to be able to insert records into the MySQL database and I am not sure how do to that using OPENQUERY. Any thoughts on that would be appreciated as well.
Thanks in advance.
View 2 Replies
View Related
Jul 14, 2002
Anyone know how to go about getting data from MySql to MS SQL server? Im a little confussed as to what ODBC driver is needed and all that. Is it possible to this all through enterprise manager? Thanks a lot.
View 1 Replies
View Related
Oct 12, 2004
:confused: Hallo! I'm trying to link a MySql 's DB in SQLServer with ODBC: the operation was susseful but I'm not able to read and write/update the data.
HELP ME PLEASE!!!
silvia, Italy
View 4 Replies
View Related
Jan 18, 2005
We are trying to do a linked server to MySQL from MS SQL2k. We downloaded MyODBC drivers, setup the system dsn successfully but then SQL errors out using both the GUI and the stored proc to add the linked server to mysql. Does anyone have a good site to reference or any words of advice. An hr or so of google didn't really give up any helpfully information.
Thanks,
DMW
View 3 Replies
View Related
Nov 8, 2006
Hi,
I have a problem , I created a linked server to mysql with following parameters:
New linked server: ServerName
Server Type: Other data Source: Microsoft OLE DB Provider for ODBC Drivers.
In the Provider String:Driver={mySQL ODBC 3.51 driver};Server="ip";Port=3306;Option=17923;Stmt=;Database="database";Uid=root;Pwd="pwd"
And I created a ODBC with mysql, and connection worked sucessfully!
The connection worked corretly until I' ve running a transact query in sql query analyzer, thats connects to MySQL and...
when I try to connect in SQL Server 2000 standard Ed. in linked Server, the following message appears to me now, and before this I was able to connect!
Server: Msg 7399, Level 16, State 1, Line 11
OLE DB provider 'MSDASQL' reported an error. The provider reported an unexpected catastrophic failure.
ODBC: Msg 0, Level 19, State 1
SqlDumpExceptionHandler: Process 169 generated fatal exception c0000005 EXCEPTION_ACCESS_VIOLATION. SQL Server is terminating this process.
OLE DB error trace [OLE/DB Provider 'MSDASQL' IDBInitialize::Initialize returned 0x8000ffff: The provider reported an unexpected catastrophic failure.
The query just make a select in MySQL, but I think that broke something...
What I have to do?
reply to my email: daniel.sarnes@antilhas.com.br
Thanks a lot!
View 4 Replies
View Related
Mar 16, 2004
Hi,
I have setup a MYSQL server as a linked server in SQL SERVER 2000. I am able to select from a table using OPENQUERY as I understand that you can't use the 4 part qualifier to access an object from MYSQL as the ODBC driver does not expose the proper interface for this. The problem is that I cannot update,delete or insert into the OPENQUERY() table
eg.
UPDATE OPENQUERY(MySQL_LinkedServer,'select id from msqlTableTest') SET id = 0
INSERT INTO OPENQUERY(MySQL_LinkedServer,'select id from msqlTableTest') VALUES(0)
DELETE FROM OPENQUERY(MySQL_LinkedServer,'select id from msqlTableTest') WHERE id = 0
This is the OLEDB PROVIDER FOR ODBC error I am getting...
The requested operation could not be performed because the OLE DB provider 'MSDASQL' does not support the required transaction interface.
OLE DB error trace [OLE/DB Provider 'MSDASQL' IUnknown::QueryInterface returned 0x80004002].
I know there are brilliant Professionals on this forum. Please tell me that this is just an MDAC upgrade or something that is not configured correctly...
View 2 Replies
View Related
Feb 27, 2007
Good Morning
the available oledb providers for mysql don't seem to work with sqlserver 2005.
So whats the best way these days of exposing data from within sql server from a mysql data base.
What I wanted to do was create a linked server connection to the mysql server using either oledb or odbc, but neither seem to work.
There is a .net provider for mysql, but that won't work to create a linked server connection.
any ideas appreciated.
What I want to do is write some scheduled proceedual sql from within sql server to query some tables in mysql and update some sqlserver tables.
thanks
David Hills
View 5 Replies
View Related
Nov 7, 2005
I can create a linked server to another MsSQL from MsSQL,but encounter error when create a linked server to MySQL:
Error 7399:OLE DB provider 'MSDASQL' reported an error.
Data source name not found and no default driver specified.
......
Anyone can help me?
Thanks!
View 6 Replies
View Related
Jun 21, 2007
Hello,I have a problem. I've linked MySql server to MsSql, in MySql I have atable with Latvian data(character set is ucs2, ucs2_general_ci) andthe problem is that when I use openquery to read data from MySQLserver, some characters are not translated correctly! I receivequestion symbols instead of Latvian special characters.Maybe someone had this kind of problem with collation?
View 2 Replies
View Related
Jun 21, 2007
When executing a query which joins against a large resultset from a linked server, SQL Server reports the following error:
Msg 7399, Level 16, State 1, Line 1
The OLE DB provider "MSDASQL" for linked server "foo" reported an error. The provider reported an unexpected catastrophic failure.
Msg 7303, Level 16, State 1, Line 1
Cannot initialize the data source object of OLE DB provider "MSDASQL" for linked server "foo".
This is using SQL Server 2005 with SP2, and MyODBC version 3.51.16 (although previous versions also seem to have the same behavior).
Once the error occurs any subsequent query against the linked server (even something as simple as select top 3 * From foo...users) fails with the same error message. Queries using the OpenQuery syntax also fail with this error.
I've tried to determine if there are some error logs that might give me more insight into what's going on, but the above events don't seem to log to the ODBC trace logs. And I can't seem to figure out a way to trace the MSDASQL (i.e., oledb) events.
I initially thought there might be a problem with the MySQL myODBC driver, but the ODBC layer itself does not seem to have a problem. But the following steps indicate otherwise:
1. Create a new Linked Server to MySQL. Same error as above
2. Execute a query against the ODBC DSN directly, using a shell program. This works fine
I'm trying to clearly identify if the problem is with the MySQL driver or with the MSDASQL provider. It would appear that the latter is at fault, given the error message, and the lack of any ODBC logging.
Would anyone have any insights about what might be going on here, and if there is any possible resolution?
View 3 Replies
View Related
Oct 27, 2007
I'm trying to use linked server to import big amount of data(around 9 million rows) from mysql to a sql 2005 table.
I plan to create a stored procedure and use job agent to run it at off-peak time everyday. The SP is like:
.....
Truncate table sqltblA;
Insert Into sqltblA(col1, col2, col3)
Select col1, col2, col3
From OpenQuery('mysql', 'Select col1, col2, col3 From mytblB')
.....
But when I tried to CREATE the above SP from management studio, seems the sql server was trying to get all data from table mytblB and ended up with failure after several minutes hang. The error message is sth. like "running out memeory". BTW, during that several minutes hang, I can't query mytblB using mysql's tool as well. it seems to me that table got locked.
However if i try to change the returned result to 100,000 rows by changing script to
Insert Into sqltblA(col1, col2, col3)
Select col1, col2, col3
From OpenQuery('mysql', 'Select col1, col2, col3 From mytblB Limit 100000')
The SP could be created without any problem and running the SP could get the data in table sqltblA.
But that's not what I want, I need all rows instead of a certain amount of rows.
Does anyone know what's going on there when I try to CREATE that SP and any solution to it?
Plus I tried to use SSIS as well. When I'm configuring the DataReader source, which uses ADO.NET's ODBC option to connect to mysql, if its sqlcommand is "select * from mytblB" without the Limit key word, then the configuration page will hang there as well and table mytblB is not accessible by using mysql tool. I'm just sick of wasting time on that and that's why I chose to use SP istead of SSIS. But same result. :-(
View 1 Replies
View Related
Aug 2, 2007
hello,guys,
my question is :
how do I query data from the linked foxpro database?
more:
I have linked a visual foxpro server to my sql server database by using the addserver clause.
Two server is in a local network.
My linked foxpro server named 'fox'.
its datasourse is not a dbc file, but a directory of dbf files ,and its full path is d:foxpro object.
In the directory ,there are three table,'show2003.dbf','sysu.dbf','szszj.dbf'.
And the .dbf files are not in any database.
They are just three files in the same directory.
There is no dbc file.
Now I can see the table list on the right page of the linked server.
But there is something wrong with my sql clause.
sample:
select * from fox..sysu
then the message is:
server: message 7313,level 16,status 1,row 1
the appointed constructure or directory to the provider is inefficacious 'MSDASQL'
I know I may use 'openquery',or 'openrowset'.
The problem is that variable is not valid in 'openquery' and 'openrowset'.
But I must use variable.
so ,please give me some advice.
Thank you very much
View 4 Replies
View Related
Feb 11, 2008
hi,
i have a table as follows:
location1 location2 Accident
a b 3
b a 5
c d 3
b c 4
c b 5
a b 2
I want to get the following output:
location1 location2 Accident
a b 10
c d 3
b c 9
I am not being able to write the correct sql query for this. Can somebody please help?
thanks,
A
View 12 Replies
View Related
Nov 4, 2005
Hi,
I would liked to know the SQL Server equivalent for the below MySQL query :
SELECT
a.col1,
a.col2,
max(a.col1)
FROM test a,
test1 b
WHERE a.col2 = b.col2
GROUP BY a.col1
Thanks,
MiraJ
View 1 Replies
View Related
Aug 21, 2007
I humbly ask for anyone's help...
I have two different databases - one in MySQL (eV12) and the other in SQL Server (Brutus). I am using DBVisualizer to perform queries. In the eV12 db, I have 3 tables to search on. In Brutus db, I have 2 tables to search on.
the problem is, I was asked to compare data from one table in eV12 to Brutus database. Is there a way to search using and SQL statement techniques?
I appreciate your expert opinions.
Regards,
Dor Marchan
student - OCC, Michigan
View 1 Replies
View Related
Jan 19, 2007
I am looking for a simple example or guidance on how to move the results of a query from a mysql database to sql server 2005 using SSIS.
It seems rather difficult to do this or at least I am stuggling to figure it out. It was easy to do in DTS, how do you do it in SSIS?
View 3 Replies
View Related
Nov 17, 2005
Hello
I am trying to recreate a MySQL database on a new domain. The original database was exported into about 40 .SQL text files. I am importing these .SQL text files into a new database using phpmyadmin. When I attempt to import the first of these files, I get a "fatal error". It says the upload time has exceeded the 300 second limit. How do I set up the server so there is no upload time limit? Or how would you approach a solution to this problem? There are about 40 of these text files and each file varies in size between 5 and 15mb. Is it possible to split individual files in half or 3 parts and import that way? Any help would be greatly appreciated. Thanks!!
View 1 Replies
View Related
Sep 20, 2007
Hi, I have been using Microsoft Access for a couple of years and we have just switched to SQL Server. However, I'm having problems querying the Mysql databases our company has in place. I have managed to establish connections in the Visual Studio but can't seem to link tables from two different databases like I could in Access. Is this possible? Also, is it possible to connect to the mysql database via management studio? Apologies for my complete lack of knowledge!
View 4 Replies
View Related
May 21, 2008
How would I import a database in SQL 2005 that was sent to me from a mysql database?
Thank you
View 11 Replies
View Related
Sep 23, 1999
How to get result from Query by group of (n) rows ?
- Is cursors the better way (and the only) ?
-Is there something as ROWNUM in Oracle or LIMIT in MySql ?
Example plz !
Thanks.
Alex
View 3 Replies
View Related
Nov 9, 2007
I made a page for a baseball league a couple of years ago using PHP and MySQL, and decided this winter to switch it to ASP.Net and SQL Server Express that comes with VWD 2005 Express Edition.
Anyways, I ran into a problem when trying to convert the query I made with MySQL into SQL Server.
My old code was something like this:
SELECT homeScore, visitorScore, ( homeScore > visitorScore ) AS homeWins, ( visitorScore > homeScore ) AS visitorWins FROM Schedule
This worked fine in MySQL, and returned the home team's score, visiting team's score, and then returned a 1 in homeWins if the home team won. Now, when I try running this query in SQL Server Express, I get an error saying "Invalid column name 'visitorScore > homeScore' ".
Can anyone please help me with what I should be doing differently so this works in SQL Server Express?! Thanks in advance!!!
View 17 Replies
View Related
Feb 28, 2003
I am currently trying to complete part of my A-level coursework but am stuck.
i am creating a website for a restaurant on which customers can submit information to do with four areas:
---------------------
Bookings
Comments
Job Applications
Pre-order
----------------------
i have used access alot in the past and had no problems creating a running model of my final database.
i have built my website and created the four tables in the alloted MySQL area that came with my website package.
BIG QUESTION:
how do i create the interface for people to submit data and for it to be sent to my database?
i am a complete beginner to MySQL using it for the first time this week so im not sure what i need to do in the slightest to solve this issue
-------------
any help or advice would be VERY VERY gratefull
View 1 Replies
View Related
May 5, 2008
Hi,
I am using Mysql ODBC 3.51 and/or 5.1 connection . this works fine with DTS But it hangs when I use with SSIS ...
MS Visual Studio is giving message like " MS Visual Studio is Busy"
Which driver should I use for SSIS?
thanks,
J
View 3 Replies
View Related
May 21, 2007
I haven't used SSRS much but I need to connect a database in MYSQL for SSRS. I right click on Datasource and do add new datasource but the only option I see is SqlNative client and Oracle client. How do I go about connecting to my database in MYSQL
View 3 Replies
View Related
Jan 25, 2007
Working on trying to support mutliple backend db's against a custom VB6 app. Right now the db is SqlExpress. It's relatively uncomplicated and I just want to move table structures and data over. Using the MySql Migration tool, I am able to authenticate as SA to a server-based instance of SqlExpress, however, only the MS-supplied databases appear as available databases; my databases don't appear. Can't seem to authenticate at all to any local instance of the database, either. Anyone done any successful migrations to MySql through their migration tool?
Rick
View 10 Replies
View Related
Dec 6, 2007
Hi,
A third party development company is creating a third party application for us in PHP and uses a MYSQL database. The app is an extension of our website which is developed in .NET and uses a MSSQL 2005 database. There are some cases where the two databases require connectivity since a few fields need to relate. We are having issues connecting the two databases on the server and after reading some forums have identified it to be a configuration issue.
I was wondering if anyone could be of any help in solving this issue, or lead us in the right direction (i.e. where to begin, forums, etc.). Here is a description and some questions from our developer:
---------------------------
We are trying to get a PHP application (.php pages running on the webserver which is the same physical machine as the MS SQL server) to connect to the database (MS SQL server). In order to facilitate this, php.ini was configured in the following manner:
mssql.secure_connection = ON
extension=php_mssql.dll
We ensured that IIS/Windows was setup properly too:
System32 and php both contain ntwdblib.dll ver 2000.80.194.0
enable pipe name protocol [Default was disable]
enable TCP/IP IP1 [Default was disable]
MS SQL Server is set to Windows AND SQL server authentication (Mixed mode).
When the PHP application attempts to connect to the database by using:
mssql_connect('localhost', '<userid>', '<password>')
produces this error message:
Login failed for user 'MAILIUSR_<computername>'. (severity 14)
Why doe this occur? Why is this IUSR userid being used? the userid we sent in with PHP was a sql userid that we know works (we use it with .NET, and to connect to the database remotely). Also, why is it using the MAIL domain? In anycase, shouldn't this IUSR userid work? it's a valid windows account, and mixed mode authentication is allowed.
-------------------------
Any assistance would be greatly appreciated!
View 2 Replies
View Related
May 1, 2007
Hello there..... im currently running a mysql database and i want to switch to a mssql database structure... creating the database is not a issue, but inserting values is a problem...
my forum has a lot of data and moving one row at a time is near insanity....
i tried this. ---
Code Snippet
INSERT INTO si_acl_groups ("group_id", "forum_id", "auth_option_id", "auth_role_id", "auth_setting") VALUES
(100, 0, 0, 14, 0),
(96, 0, 15, 0, 1);
but i only get this error. ---
Msg 102, Level 15, State 1, Line 2
Incorrect syntax near ','.
any suggestion...
i was able to dump the mysql database into a .sql file but it just gives the same error when i execute...
please help...
View 15 Replies
View Related
Sep 23, 2006
Hie !
Please, how to manage (attach,connect to) MySql database located on host server http://www.avanti.si from my home PC with Microsoft SQL Server Management Studio Express? This "http://www.avanti.si:8080MySqlDatabaseName,3306" fail !
Thenks!
View 4 Replies
View Related
Feb 21, 2008
I want to schedule a job to run nightly where a remote mysql database is imported into a local sql server db. I ran through the wizard for scheduling a job, previewed my table data, and viewed the scheduled job in the DTS queue. However, the job never runs. I can't figure out why.
Anyone have any idea why? Is there a step-by-step process somewhere for doing this?
Thanks,
C
View 1 Replies
View Related
Mar 16, 2007
Hi Every bdy,
I have a database which is in mysql. Now we want to port that database to Sql Server 2005. Please tell the steps to do this.
With Regards
Ravinder Reddy.K
View 6 Replies
View Related