Just sharing some of my inconsequential lunch conversations with you... RSS  

Monday, July 23, 2007

Merge in SQL Server 2008

At last, a new feature on a database!

merge [target] t
using [source] s on t.id = s.id
when matched then update t.name = s.name, t.age = s.age -- use "rowset1"
when not matched then insert values(id,name,age) -- use "rowset2"
when source not matched then delete; -- use "rowset3"

Read it about it here.



No comments:

Development Catharsis :: Copyright 2006 Mário Romano