> SQL Server對使用OUTPUT
語句與觸發器的語句中使用
建議的解決方案涉及用>用兩個步驟的過程取代單一
語句:
UPDATE
OUTPUT
重要說明:SELECT
UPDATE
-- Fetch the original data before the update SELECT BatchFileXml, ResponseFileXml, ProcessedDate FROM BatchReports WHERE BatchReports.BatchReportGUID = @someGuid; -- Execute the update operation UPDATE BatchReports SET IsProcessed = 1 WHERE BatchReports.BatchReportGUID = @someGuid;
>使用擷取資料可能會對效能產生負面影響,尤其是在具有實質行尺寸的表中。 >
資料一致性問題:OUTPUT
子句限制。 以上是如何使用觸發器解決SQL Server的輸出條款錯誤?的詳細內容。更多資訊請關注PHP中文網其他相關文章!