sql error

  • That's completely invalid syntax, bears no resemblance to an update statement, looks like an insert statement with the INSERT INTO replaced by an UPDATE SET and nothing else changed.

    UPDATE targettable

    SET description = a.description,

    corporate_tag = a.corporate_tag,

    corporate = a.corporate,

    banner_tag = a.banner_tag,

    banner = a.banner,

    region_tag = a.region_tag,

    region = a.region,

    division_tag = a.division_tag,

    division = a.division,

    hierarchy_level = a.hierarchy_level,

    load_id = a.load_id,

    process_name = a.process_name,

    loop_id = a.loop_id

    FROM targettable

    INNER JOIN viewname a ON targettable.SomeColumn = a.SomeColumn

    WHERE b.operation = 'U'

    AND a.corporate_Tag = b.corporate_Tag

    OR a.banner_tag = b.banner_tag

    OR a.region_Tag = b.region_Tag

    OR a.division_Tag = b.division_Tag

    I haven't specified the join condition, because there wasn't enough info to do so.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass

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

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