Query between objects / servers in SMS 2008

  • Hi,

    I had a piece of syntax that was able to query between multiple objects within the 'Object Explorer' window which allowed me to do joins across servers without needing to use the 'linked server' function.

    I believe the syntax was something like ‘JOIN server2..dbo.tblname’ (I believe it had double ‘..’ before the .dbo).

    I cannot remember where I got this syntax from, but I think it was likely from one of the Itzik Ben-Gan books but I cannot find any reference.

    If anyone is able to help with this syntax or provide an alternative to using linked servers I would be most grateful

    Thanks,

  • Are you sure it was servers and not just databases?

    Jason...AKA CirqueDeSQLeil
    _______________________________________________
    I have given a name to my pain...MCM SQL Server, MVP
    SQL RNNR
    Posting Performance Based Questions - Gail Shaw[/url]
    Learn Extended Events

  • could it be based on an openrowset command??

    --database name required

    SELECT *

    FROM OPENROWSET( 'SQLNCLI',

    'Server=DEV223\SQL2012;Trusted_Connection=yes;',

    'SET FMTONLY OFF; SET NOCOUNT ON; SELECT * FROM HDSDEV1200.sys.TABLES'

    )

    since the above returns a table, i could wrap it an alias and join it agaisnt something else

    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!

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

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