Remove SET ROWCOUNT from existing code
- Last UpdatedApr 24, 2025
- 1 minute read
You will need to remove SET ROWCOUNT from your existing custom code and should not be using it in any new code. It is recommended that you use TOP as a replacement for SET ROWCOUNT in existing and new custom code. For more information on how to use TOP instead of SET ROWCOUNT, see the following two links:
-
https://msdn.microsoft.com/en-us/library/ms188774.aspx
-
https://msdn.microsoft.com/en-us/library/ms189463.aspx
Note: It is important to read the full documentation for SET ROWCOUNT and TOP to identify limitations, syntax, restrictions, and best practices. Some suggestions are given below, but it is your responsibility to read Microsoft documentation in full, understand the nature of the query, and change the code to use TOP instead of SET ROWCOUNT properly.