need a merge workaround

  • I need to change a loading proc and i was going to use the merge. Turns out the merge statement is not supported in 2005. Anyone have any suggestions or merge like functionality.

    Should i just write an update/insert/delete?

  • Merge was introduced in SQL 2008. In prior versions of SQL Server, you have to build your own set of update, insert, delete statements. Used to be called "upsert scripts".

    Wrap it all in the appropriate transactions, is the main warning to give you on doing it that way. It's easy to build an upsert, but I've seen some that would commit partially and create problems thereby.

    - Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
    Property of The Thread

    "Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon

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

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