How to read data from mysql to mssql server

  • hi friends.....

    i have created one linkedserver on sql server 2005 and i am reading data from mssql server to mysql through linked server....

    my question is how i can read data from mysql to mssql

    can any one provide syntax.......

  • naresh.talla (12/14/2010)


    i have created one linkedserver on sql server 2005 and i am reading data from mssql server to mysql through linked server....

    my question is how i can read data from mysql to mssql

    can any one provide syntax.......

    This particular question belongs to a MySQL forum rather than a SQL Server one.

    Having said that, I would start by researching MySQL ODBC connectivity.

    Hope this helps.

    _____________________________________
    Pablo (Paul) Berzukov

    Author of Understanding Database Administration available at Amazon and other bookstores.

    Disclaimer: Advice is provided to the best of my knowledge but no implicit or explicit warranties are provided. Since the advisor explicitly encourages testing any and all suggestions on a test non-production environment advisor should not held liable or responsible for any actions taken based on the given advice.
  • linked server syntax:

    Once you have the Linked Server in place I have found a few different ways of interacting with the mysql database:

    Select Statements:

    select * from mysql5...country

    select * from OPENQUERY(mysql5, 'select * from country')

    Insert Statements:

    insert mysql5...country(code,name)

    values ('US', 'USA')

    insert OPENQUERY(mysql5, 'select code,name from country;')

    values ('US', 'USA')

    Other Statements:

    EXEC('truncate table country') AT mysql5;

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • Lowell (12/15/2010)


    ...Once you have the Linked Server in place I have found a few different ways of interacting with the mysql database

    I understand poster is looking for the other way around, MySQL being the local database and SQL Server being the remote one. Did I get it wrong?

    _____________________________________
    Pablo (Paul) Berzukov

    Author of Understanding Database Administration available at Amazon and other bookstores.

    Disclaimer: Advice is provided to the best of my knowledge but no implicit or explicit warranties are provided. Since the advisor explicitly encourages testing any and all suggestions on a test non-production environment advisor should not held liable or responsible for any actions taken based on the given advice.
  • no, you read it right...my attention deficit order only let me read the first eight words of the thread before i came to a conclusion...

    Thansk Paul!

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • thanks for post......

  • Dear sir,

    I am new on mssql (now a little of it) and I saw your post, can you tell me how I can create one linkedserver on sql server 2005 so that I also can read my data from mssql to mysql

    have a nice day

Viewing 7 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic. Login to reply