Results 1 to 6 of 6

Thread: how to take data in a one table from two different server ?

  1. #1

    how to take data in a one table from two different server ?

    when i use a two server . i want take a data from a two different server in a
    single table . plz give me suggetion for me


  2. #2
    Moderator
    Join Date
    Jun 2007
    Answers
    2,074

    Re: how to take data in a one table from two different server ?

    connect from one server to another through proper authorisation then read the data.


  3. #3
    Contributing Member
    Join Date
    Feb 2007
    Answers
    34

    Re: how to take data in a one table from two different server ?

    Hi Hitesh!
    I guess u need use "join". write a procedure which connect both the servers & then connect the databases and then use join for combine tables.
    Hope this will work!
    Thanks & Regards.
    M.A.Raafay.


  4. #4
    Expert Member
    Join Date
    Sep 2006
    Answers
    477

    Re: how to take data in a one table from two different server ?

    debasisdas How exactly do you connect from one data server to another, read and store/join the data to the other server?

    raafay, where will this procedure(I assume you are talking about DB stored procedure) reside that can join both tables from two different servers??

    There might be many ways of achieving this work done. One among them is to use the import/export functions of the database. Export the data from one data server into a file, import it to the other.
    After that it is child's play to work with the data you have.

    Usually you can do this 9If in Unix) by just writing a script that connects to one server, exports the data exit the connection. Connect to the other server where you want to store the final data , import this exported data file...

    But in reality we bearly get into such situation. Related tabled should be maintained in a single database and the communication between data servers if needed must be better architectured.

    If you need any more help/info, let me know.

    Cheers!
    Kalayama

    [COLOR="Blue"][SIZE="2"]"If you are not living on the edge of your life, you are wasting space"[/SIZE][/COLOR]

    Someone says "Impossible is nothing". The man next him says "Let me see you licking your elbow tip!"

  5. #5
    Junior Member
    Join Date
    Aug 2007
    Answers
    7

    Re: how to take data in a one table from two different server ?

    Using LinkedServer concept we can connect & get the data's from the 2 different database or different servers..

    Using OPENDATASOURCE we can get it.

    Syntax:
    OPENDATASOURCE ( provider_name, init_string )

    refer the SQL Server Help
    http://msdn2.microsoft.com/en-us/library/ms179856.aspx


  6. #6
    Junior Member
    Join Date
    Aug 2007
    Answers
    1

    Re: how to take data in a one table from two different server ?

    Hi,

    I am not sure where you want to use the data but you can follow the below method.

    First Need to create a view like Select * from server1.table Union Select * from Server2.table

    then your view will be ready to use if structure of both tables is same.

    Regards,
    Upendra


  7.  Sponsored Ads
    Ad


     

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
About us
Applying for a job can be a stressful and frustrating experience, especially for someone who has never done it before. Considering that you are competing for the position with a at least a dozen other applicants, it is imperative that you thoroughly prepare for the job interview, in order to stand a good chance of getting hired. That's where GeekInterview can help.
Interact