Mega Code Archive

 
Categories / Delphi / ADO Database
 

Set nocount on causes couldnt perform the edit because another user changed the record error

Question: How come after I execute SET NOCOUNT ON on MSSQL server all updates result in the error "Couldn't perform the edit because another user changed the record"? BDE error 10259. Answer: The BDE uses rows effected to determine if an UPDATE is successful. SET NOCOUNT ON tells MSSQL to return 0 for rows effected for all UPDATE statements and thereby causing all UPDATES to fail.