# Smart Client adds "TOP" for SQL Server Queries

**URL:** <https://forum.servoy.com/t/smart-client-adds-top-for-sql-server-queries/20383>\
**Category:** Questions\
**Created:** [November 29, 2020, 2:04pm UTC](https://forum.servoy.com/t/smart-client-adds-top-for-sql-server-queries/20383 "2020-11-29T14:04:14Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![gdurniak](https://avatars.discourse-cdn.com/v4/letter/g/a698b9/32.png) [@gdurniak](https://forum.servoy.com/u/gdurniak)\
**Post date:** [November 29, 2020, 2:04pm UTC](https://forum.servoy.com/t/smart-client-adds-top-for-sql-server-queries/20383/1 "2020-11-29T14:04:14Z")

</div>

Servoy version 7.4.3 -releaseNumber 2036  
While our Repository is still SQL Anywhere 17, our Data is now on SQL Server

For some reason, Servoy adds “TOP x” to every Query e.g. “SELECT TOP 2 names where ID \< 5”, which is odd. Why ?  
The desired Query is "“SELECT names where ID \< 5"”, run using databaseManager.getDataSetByQuery( ‘db’, string, null, -1 );  
The results are displayed as HTML in a pop up Smart Client Form

This does not happen with SQL Anywhere  
It occurs for both Views and Tables  
I see it in the Servoy Admin ‘Performance Data’ page, which shows the actual queries as sent to the backend database  
Is this a SQL Server quirk ? an obscure Servoy setting somewhere ? is -1 not all rows ?

greg

---

<div class="post-metadata">

**Author:** ![gdurniak](https://avatars.discourse-cdn.com/v4/letter/g/a698b9/32.png) [@gdurniak](https://forum.servoy.com/u/gdurniak)\
**Post date:** [December 4, 2020, 7:53am UTC](https://forum.servoy.com/t/smart-client-adds-top-for-sql-server-queries/20383/2 "2020-12-04T07:53:21Z")

</div>

After a Servoy machine restart, addition of “TOP” appears to have stopped

Very strange

greg
