🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: cn.bbs.comp.database
Article #633

[MSSQL]Question of the Day

#633
From: Galaxy��VOLUNTEERS��Database
Date: Fri, 28 Nov 2008 03:25
23 lines
1515 bytes
Which of the following operations can be performed by MERGE statement in SQL 
Server 2008?
By Sudhir Chawla



Answer: 
WHEN MATCHED 
WHEN NOT MATCHED BY TARGET
WHEN NOT MATCHED BY SOURCE 
Explanation: 1st Three are correct answers. Merge use to check if values 
match in both Source and Target, which is equal to WHEN MATCHED and an 
UPDATE is fired. When value exist in SOURCE table but not in TARGET table 
then WHEN NOT MATCHED [ BY TARGET ] then INSERT the new value and if the 
value exist in TARGET and not in SOURCE then WHEN NOT MATCHED [BY SOURCE] 
and DELETE is fired. 
Ref: Merge - http://msdn.microsoft.com/en-us/library/bb510625.aspx 
--
Welcome to Database Board
��ӭ������ݿ��
http://bbs.sjtu.edu.cn/bbsdoc?board=database

�� ��Դ:����ˮ˼Դ bbs.sjtu.edu.cn��[FROM: 207.46.55.28]
Technical Details
Message-ID: <4dELeY$b8e@bbs.sjtu.edu.cn>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!news1.google.com!news.glorb.com!feeder.erje.net!newsfeed.straub-nv.de!news.shec6.edu.cn!SJTU

Show Full Headers
Complete Article Headers
X-Google-Thread: 101948,5d3ce33c2c6c6123
X-Google-Attributes: gid101948,domainid0,public,usenet
X-Google-Language: ENGLISH,GB
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!news1.google.com!news.glorb.com!feeder.erje.net!newsfeed.straub-nv.de!news.shec6.edu.cn!SJTU
From: Dem.bbs@bbs.sjtu.edu.cn (Galaxy��VOLUNTEERS��Database)
Newsgroups: cn.bbs.comp.database
Subject: [MSSQL]Question of the Day
Date: 28 Nov 2008 03:25:36 GMT
Organization: ��ˮ˼Դ
Message-ID: <4dELeY$b8e@bbs.sjtu.edu.cn>
Mime-Version: 1.0
Content-Type: text/plain; charset="gb2312"
Content-Transfer-Encoding: 8bit
X-Filename: database/M.1227842722.A