对于SQL来说是新手,是否有人会知道执行以下更新的更快方法?寻找一种更快的方式来更新SQL表上的许多列
也许使用数组或对每个元素。
update ItemDynamic
set price = SnapShotPrice
where SnapShotPrice <> Price
update ItemDynamic
Set PriceLevelA = SnapShotPriceA
where snapshotpriceA <> PricelevelA
update ItemDynamic
Set PriceLevelB = SnapshotpriceB
where snapshotpriceB <> PricelevelB
update ItemDynamic
Set PriceLevelC = SnapshotpriceC
where snapshotpriceC <> PricelevelC
它们被称为索引。 SSMS附带一个查询分析器,可以建议添加索引。你应该使用它。 – Will
更新语句3和4看起来是相同的。它是否正确? –