SQL Server 2008 ããã¯ãMERGE ã¹ãã¼ãã¡ã³ãããµãã¼ãããã¾ãããMERGE ã¹ãã¼ãã¡ã³ãã¯ããã¼ã¿ãåå¨ããå ´åã«ã¯ UPDATE ããåå¨ããªãå ´åã«ã¯ INSERT å¦çãè¡ããã¹ãã¼ãã¡ã³ããªã®ã§ãUPSERT ã¨ãå¼ã°ãã¦ãã¾ãï¼UPDATE 㨠INSERT ãçµã¿åãããé èªï¼ã MERGE ã¯ã次ã®ããã«è©¦ãã¾ãï¼t1 㨠t2 ãã¼ãã«ãä½æãã¦ãããããã¼ã¸ï¼ã CREATE TABLE t1 ( a int, b varchar(100) ) INSERT INTO t1 VALUES ( 1, 'AAA' ) ,( 2, 'BBB' ) ,( 3, 'CCC' ) ,( 4, 'DDD' ) CREATE TABLE t2 ( a int, b varchar(100) ) INSERT INTO t2 VALUES ( 3, 'XXX' )
{{#tags}}- {{label}}
{{/tags}}