Results 1 to 2 of 2
  1. #1
    Join Date
    Feb 2011
    Posts
    30

    Unanswered: Linked Server Mysql and MSSQL

    hi all,

    I have created a linked server from MSSQL to mysql using the instructions here
    How to Create Linked Server for a MySQL database using SQL Server Management Studio

    i can browse my tables that i have in the mysql db from the MSSQL server. But i am having issues inserting info from the MSSQL db to the MYSQL db.

    I have tried modifying this command:

    INSERT into openquery(MySQL,'select * from db_name.table_name')
    select * from db_name.dbo.table_name

    but i get the following error :

    OLE DB provider "MSDASQL" for linked server "MySQL_Link" returned message "[MySQL][ODBC 5.1 Driver][mysqld-5.5.11]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 'dbo.rsaccount' at line 1".
    Msg 7350, Level 16, State 2, Line 1
    Cannot get the column information from OLE DB provider "MSDASQL" for linked server "MySQL_Link".

    Now i am using MSSQL 2005 and Mysql 5.1 .. any ideas or suggestions would be greatly apperciated..

  2. #2
    Join Date
    Apr 2011
    Location
    Pakistan
    Posts
    28
    You are using MySQL but your linked server name is MYSQL_LINK use as

    INSERT into openquery(MySQL_link,'select * from db_name.table_name')
    select * from db_name.dbo.table_name

    check this query if not then check this query also

    INTERT INTO MYSQL_LINK.DBNAME.SCHEMANAME.TABLENAME
    SELECT * FROM DBNAME.DBO.TABLENAME

    Regards,

    Syed Jahanzaib Bin Hassan
    MCTS | MCITP | OCA | OCP | OCE | SCJP | IBMCDBA

    My Blog
    A|U|R|E|U|S – S|A|L|A|H

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •