Should I switch databases inside the procedure?

How can I use USE statements inside the procedure to change from one database to another in SQL 2000? Is there any command for switching from one database to another database?

    Requires Free Membership to View

Rather than switching databases, just refer to the table in the other database directly eg: SELECT SomeColumn FROM SomeDatabase.dbo.SomeTable

This was first published in December 2005

Join the conversationComment

Share
Comments

    Results

    Contribute to the conversation

    All fields are required. Comments will appear at the bottom of the article.