Hi
I'm trying to limit my result set by using SET ROWCOUNT N where N is my
desired number of rows. The program runs against SQLServer 2000. SQLProfiler
shows the following trace but the row count limit is not applied.
declare @P1 int
set @P1=196
exec sp_prepexec @P1 output, NULL, N'SET ROWCOUNT 6'
select @P1
exec sp_unprepare 196
declare @P1 int
set @P1=197
exec sp_prepexec @P1 output, NULL, N'SELECT USR.USER_ID, USR.FIRST_NM,
USR.LAST_NM, USR.TITLE_TX, USR.LOGIN_ID, USR.PASSWORD_TX, USR.USER_TYPE_CD,
USR.EFF_START_DT, USR.EFF_END_DT, USR.PARTITION_GROUP_NM, USR.LOCK_ID FROM
USERS USR ORDER BY USR.LAST_NM ASC, USR.FIRST_NM ASC'
select @P1
For reasons difficult to describe I can not modify to use SELECT TOP syntax.
Is there a way to set the ROWCOUNT on the connection via the ODBC API so
that it will take effect on my statements executed over that connection?