--实际只会更新一条。可有效防止误操作、特别是操作线上正式数据时。

UPDATE TOP(1) Table2 SET Culumn1='value'
WHERE id IN(269102,269104)

<OrderKey>000000102153003,</OrderKey>
<OrderKey>000000102153337,</OrderKey>
<OrderKey>000000102153293,</OrderKey>
<OrderKey>000000102153411,</OrderKey>(若AS OrderKey 没有则直接以,相连)

SELECT '000000'+OrderId AS OrderKey
FROM Order
WHERE CreateDate>'2016-11-10'
FOR XML PATH('')

ISNULL(COLUMN,0)

SELECT OrderId,ISNULL(OrderFlag,0) AS OrderFlag  --给null列设置默认值0
FROM TCCLine.dbo.CLine_Order

04-19 21:42