• TryingToLearn (12/29/2012)


    i am querying a MySql view for data, but need to join to a sql table for three additional fields.

    SET IDENTITY_INSERT CALLSNEW ON

    INSERT INTO [cas].[dbo].[CALLSNEW]

    ([calls_key]

    ,[ext])

    SELECT * FROM OPENQUERY(PHONEDB,'SELECT calls_key, ext FROM calls')

    Where calltype IN ( 'from-internal', 'ext-local', 'ext-queues', 'ext-grou')

    but i need to join to a linked SQL server as well to get a few more fields. I could use suggestions on how to do that.

    SELECT dept = dbo.EMP.dept, fname = dbo.EMP.fname, lname = dbo.EMP.lname, empnum = dbo.EMP.empnum

    FROM linkedserver.dbo.EMP

    WHERE dbo.EMP.ext = ext

    AND dbo.EMP.active = 1

    thanks for your time.

    Need more information. From just what you have posted, not sure how these two tables are related and could be joned together.