how to link two different database as

  • I have one situation

    On my company production server We have two different Server. All the store procedure and Sql Query refer as Server1.database1.dbo.table1/Server2.database2.dbo.table2

    Now on developtment evironment We have only one Server and it has two different database. Now when we develop something or test store procedure We are using just ouery like database1.dbo.table1/database2.dbo.table2.

    which is working fine. but when we put everything on Produciton server we nneed to change every store procedure and Query.

    Is there any commmon place to link two database same as production evviroment so I do not have to change anything everytime when putting on Production and works fine.

    Jwalin

  • In SQl 2000, I can't think of an easy way.

    in SQL 2005, you could use a synonym...for example two synonyms like

    PRIMEDB and OTHERDB

    and the query could refer to

    PRIMEDB .table1/OTHERDB.table2

    on production, the synonyms woulld point to Server1.database1.dbo/Server2.database2.dbo

    but in development, the synonyms could point to

    database1.dbo.table1/database2.dbo.table2.

    The other alternative would be, that on dev, create two linked servers to itself, so that the syntax was still the same.

    jwalin (2/20/2009)


    I have one situation

    On my company production server We have two different Server. All the store procedure and Sql Query refer as Server1.database1.dbo.table1/Server2.database2.dbo.table2

    Now on developtment evironment We have only one Server and it has two different database. Now when we develop something or test store procedure We are using just ouery like database1.dbo.table1/database2.dbo.table2.

    which is working fine. but when we put everything on Produciton server we nneed to change every store procedure and Query.

    Is there any commmon place to link two database same as production evviroment so I do not have to change anything everytime when putting on Production and works fine.

    Jwalin

    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!

  • thank you vey much to sending me very quick reply ... I appriciate.

    To Create two linked server to itself, I need to do it on each developer machine? Am I right?

    If prossible Could you please send me the syntax ?

  • damn...i just tried to do it, so i could script out the linked server commands, and i get "cannot create a linked server from a local server" from the gui.

    anyone else have a suggestion?

    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!

  • Just quick question, This setting is only for my machine or it is common for all ... as in my team we have 5 people.. so do i have to do each machine?

  • could you please send me the gneral syntax for connecting server

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

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