Insert Into Probelms

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Steve Bishop

    Insert Into Probelms

    I'm getting: Server: Msg 107, Level 16, State 3, Line 1
    The column prefix 'tMembersClone' does not match with a table name or
    alias name used in the query. Help appreciated. Thanks.

    INSERT INTO ResultSet (CustomerNumber , CustomerName, AddressLine1,
    AddressLine2, AddressLine3,Ci ty, State, Zipcode, CountryCode,
    PhoneNumber, FaxNumber, emailAddress, URLAddress,Sale sPersonCode,
    Active, SICCode, SIC_Description , Stat)

    SELECT tMembersClone.C ustomerNumber, tMembersClone.C ustomerName,
    tMembersClone.A ddressLine1,
    tMembersClone.A ddressLine2, tMembersClone.A ddressLine3,
    tMembersClone.c ity, tembersClone.St ate,tMembersClo ne.Zipcode,
    tMembersClone.C ountryCode, tMembersClone.P honeNumber,
    tMembersClone.F axNumber, tMembersClone.e mailAddress,
    tMembersClone.U RLAddress,
    tMembersClone.S alesPersonCode, tMembersClone.A ctive,
    tMembersClone.S ICCode,
    tMembersClone.S IC_Description, tMembersClone.S tat
    FROM tMembersClone As A INNER JOIN tMembers As B ON a.CustomerNumbe r =
    B.CustomerNumbe r AND
    A.customerName = B.CustomerName
    WHERE
    A.AddressLine1 <> B.AddressLine1 OR
    A.AddressLine2 <> B.AddressLine2 OR
    A.AddressLine3 <> B.AddressLine3 OR
    A.city <> B.city OR
    A.State <> B.State OR
    A.Zipcode <> B.Zipcode OR
    A.CountryCode <> B.CountryCode OR
    A.PhoneNumber <> B.PhoneNumber OR
    A.FaxNumber <> B.FaxNumber OR
    A.emailAddress <> B.emailAddress OR
    A.URLAddress <> B.URLAddress OR
    A.SalesPersonCo de <> B.SalesPersonCo de OR
    A.Active <> B.Active OR
    A.SICCode <> B.SICCode OR
    A.SIC_Descripti on <> B.SIC_Descripti on OR
    A.Stat <> B.Stat;

    *** Sent via Developersdex http://www.developersdex.com ***
    Don't just participate in USENET...get rewarded for it!
  • DCM Fan

    #2
    Re: Insert Into Probelms

    You've ALIASed table tMembers "A" in the FROM clause, but your SELECT caluse is
    still referencing tMembers...chan ge all o the tMember references to A inthe
    SELECT and you'll be good.

    Comment

    Working...