• TryingToLearn (12/29/2012)


    I now need to turn this into a insert statement, calls_key a the primary key and i'm getting a new error on that issue. Can you help on that?

    Thank you

    SET IDENTITY_INSERT CALLSNEW ON

    --INSERT INTO [CALLSNEW]

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

    SELECT

    calls_key = oq.calls_key,

    ext = oq.ext,

    calltype = oq.calltype,

    dept = e.dept,

    fname = e.fname,

    lname = e.lname,

    empnum = e.empnum

    FROM

    [EMP] e

    inner join OPENQUERY(PHONEDB,'SELECT calls_key, ext, calltype FROM calls') oq

    on (e.ext = oq.ext)

    WHERE

    e.ext = oq.ext

    AND e.active = 1

    and oq.calltype IN ( 'from-internal', 'ext-local', 'ext-queues', 'ext-group')

    Nope, I have no idea what the problem is with your code. My crystal ball has been in the shop for years, and I don't expect to get it back anytime soon. Also, the force may be strong in this one, but it isn't that strong.

    What all the sarcasm is saying is that you haven't provided enough information for anyone not looking over your shoulder to be able to help you.

    Please read the first article I reference below in my signature block. It will walk you through everything you need to post to get the best possible answers to your questions.