Thursday, 2 June 2011

SQL MERGE function...

All of us who have used databases have come accross scenarios that would have been made easier if the MERGE function was avaliable from the start...

It allows you to target a table with some data, and either update it if it allready exists or insert if it doesnt (or any other logic in between)!

Check it out here: http://technet.microsoft.com/en-us/library/bb510625.aspx

(Now is probably a good time to look at Common Table Expressions too! (CTE's))

Enjoy,

T

No comments:

Post a Comment