You need to add some intelligence to the query to tell it which rows (rather than the same rows) to pick. One way to approach this is to
a) put all the data you want to export into temporary table
b) add a column to indicate a serial number
c) pick the rows to export based on the serial number.
In your case, the code would be something like this:
-- This puts all the data into a temporary table.
-- Fix your query - what should be E.Name? I set it to "Something?"
E3.DESCRIPTION AS EXPOSURE_TYPE
INNER JOIN EDIT_LONG_CODE E
ON E.TBNAME = 'MPL_EXPOSURE' AND E.NAME = 'Something?'
M.POLICY_NUMBER NOT LIKE 'Q%'
-- Now add a sequence number column to the temp table
ALTER TABLE #tmp ADD SeqNum INT NOT NULL IDENTITY(1, 1) PRIMARY KEY CLUSTERED;
And then run the select statement from the temp table.
DECLARE @ChunkSize INT, @TotalRowsToExport INT;
SET @ChunkSize = 10;
SELECT @TotalRowsToExport = COUNT(*) FROM #tmp;
DECLARE @counter INT
SET @counter = 0;
WHILE @counter < @TotalRowsToExport
SELECT TOP (@ChunkSize)
SeqNum > @counter
SET @counter = @counter+@ChunkSize;
The code compiles, but I have not tested it.