Changing DATABASE dynamically

Last post 05-27-2008, 6:54 AM by veysel. 1 replies.
Sort Posts: Previous Next
  •  05-22-2008, 7:43 AM Post number 54448

    Changing DATABASE dynamically

    I have a stored procedure wich will work with two different user defined databases. i want to know  how i can switch two diffrent databases in my stored procedure

    i tried something like this

    use @source_db

    and

    exec ('use ' + @source_db)

    both are not working. any one have idea is highly appreciated

    thanks in advance

  •  05-27-2008, 6:54 AM Post number 55875 in reply to post number 54448

    • veysel is not online. Last active: 27-05-2008, 7:23 AM veysel
    • Top 500 Contributor
    • Joined on 05-27-2008
    • Istanbul
    • Level 1: Deep thought

    Re: Changing DATABASE dynamically

    hi shamraj,

    do you need to use SP and change with "use"? because you can use two or more DB at same time. 

    can you write your sample may I help.

    VI


    Veysel Ispir
    Istanbul TUR
View as RSS news feed in XML