SQL Server SET NOCOUNT ON and SET XACT_ABORT ON: Improving Performance and Data Integrity
The "SET NOCOUNT ON;" statement is used to suppress the "xx rows affected" message that is returned after executing a SQL statement. This can be useful in improving performance by reducing network traffic. The "SET XACT_ABORT ON" statement is used to automatically roll back a transaction if a run-time error occurs. This ensures that the database remains in a consistent state and prevents any partial updates from being applied.
原文地址: https://www.cveoy.top/t/topic/pxk7 著作权归作者所有。请勿转载和采集!