I have a query where I like to run in another server and database

Jonathan Brotto 420 Reputation points
2024-07-23T14:46:46.1766667+00:00

I opened a query in another database, and I would like to run it in another window. Is there a way to do that while keeping the same query window? For example server A database Q to server B database Y.

SQL Server Training
SQL Server Training
SQL Server: A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.Training: Instruction to develop new skills.
14 questions
0 comments No comments
{count} votes

Accepted answer
  1. Zahid Butt 956 Reputation points
    2024-07-23T15:00:01.31+00:00

    Hi,

    I think you want to change connection remaining in same window, pls follow below instructions:

    If you are using SQL Server Management Studio (SSMS), right click in the query window, select connection->Change Connection, here you may select Server B to connect. After connection you may select database.

    Regards,

    1 person found this answer helpful.
    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.