• sqldba_newbie (4/9/2012)


    thanks for detail explanation. Dumb question, how do i know size of my sql query?

    Using your sample code from earlier the bold string-literal is the 'query' argument:

    SELECT *

    FROM OPENQUERY([remoteserver],

    'SELECT w.ID,

    w.[Rdc],

    w.[Pby],

    w.[Tp],

    w.[Mp],

    w.[OpC],

    w.[PType],

    w.[PCde],

    w.[RTye],

    w.[RCde],

    CASE WHEN e.PCde IS NOT NULL THEN ''Yes''

    WHEN e.pCde IS NULL THEN ''No''

    END AS [Rts],

    COALESCE(re.RSs, ''hold'') AS RStts

    FROM (

    SELECT *

    FROM mydb.dbo.rdw

    WHERE PType = ''T''

    ) w

    LEFT JOIN mydb.dbo.caur e ON w.PCde = e.PCde

    AND w.RCde = e.rCde

    AND w.PTpe = e.PTpe

    LEFT JOIN mydb.dbo.revv re ON w.Id = re.rDsId');

    EDIT: forum cross-post edited this somehow...putting the furniture back...

    There are no special teachers of virtue, because virtue is taught by the whole community.
    --Plato