Sample query to run on multiple sql servers

Posted on 2012-09-12
Last Modified: 2012-09-17
Hi Friends,

Need a sample query that must run on MULTIPLE SQL 2008 SERVERS from a same query window.

Central mgt sever is not a option, please note.

Please assist.
Question by:Minesh Shah
    LVL 9

    Expert Comment

    using Fully Qualified Name you can query to more than one server.
    for this u need to add linked server in your server using credentials.
    LVL 10

    Author Comment

    by:Minesh Shah
    how can i, please tell step by step..
    LVL 3

    Accepted Solution

    You can specify your from statements to include server name like in this example below:

    Select * 
    From [ServerName].[DBName].[dbo].[TableName]

    Open in new window

    LVL 10

    Author Closing Comment

    by:Minesh Shah

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    What Should I Do With This Threat Intelligence?

    Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

    This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
    In this article we will get to know that how can we recover deleted data if it happens accidently. We really can recover deleted rows if we know the time when data is deleted by using the transaction log.
    This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
    Viewers will learn how to use the INSERT statement to insert data into their tables. It will also introduce the NULL statement, to show them what happens when no value is giving for any given column.

    737 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    20 Experts available now in Live!

    Get 1:1 Help Now