[dba-SQLServer] Every 100th record

Shamil Salakhetdinov shamil at users.mns.ru
Fri Aug 27 13:45:07 CDT 2004


John,

Cursors and FETCH RELATIVE n is one of the answers.
See BOL for more details.

Another solution is possible if your source data table/view/UDF returns
unique IDs then you can populate a temp table with these IDs and
correponding Identity field and then write a join ..... you got it I
see... :)

HTH,
Shamil

----- Original Message ----- 
From: "John W. Colby" <jwcolby at colbyconsulting.com>
To: <dba-sqlserver at databaseadvisors.com>; <accessd at databaseadvisors.com>
Sent: Friday, August 27, 2004 6:50 PM
Subject: [dba-SQLServer] Every 100th record


> Does anyone have a strategy for pulling every Nth record?  My client
wants
> to pull every 100th record into a dataset for analysis, to speed
things up I
> am guessing.
>
> John W. Colby
> www.ColbyConsulting.com
>
>
> _______________________________________________
> dba-SQLServer mailing list
> dba-SQLServer at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/dba-sqlserver
> http://www.databaseadvisors.com
>




More information about the dba-SQLServer mailing list