I want to retrieve data from table with 28 million rows. I want to retrieve 1 million rows at a time.
I have checked answers from following links Get data from large table in chunks How can I get a specific chunk of results? The solution suggests a query which has int ID column. In my case I have primary key column with varchar(15) as data type
I want to use something like this which is faster - Select top 2000 * from t where ID >= @start_index order by ID
But since the ID column is varchar, I can not use integer index.
How can I efficiently get data in chunks from a table with primary key having varchar data type?