Click here to Skip to main content
15,896,359 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi I have one table,in that more 10000 records,in one fields is may or may not NULL,i need to get records ,those fields are NULL from 10000 records.Below is my table fields.

SQL
DocumentName, [Document], Path, Version,SWF


In this Document and SWF fields are file stream,i mean i store binary data of files in that fields.All row of Document fields got binary data,but SWF fields some row is NULL.
So here i need to get which SWF fields is NULL from more than 10000 records.
If i use following query
SQL
select DocumentName, [Document], Path, Version,SWF from FTRepository where ([SWF] IS NULL)


It show "Timeout expired" error,here i attach screenshot link
http://prntscr.com/6rfidq[^]


IF i use following query still show same error,here i use top of 200 with where condition,if without where condition get result,but i need where condition,But this is not good idea,bcz always it retrieve top most 200 records,i mean all time it retrieve same 200 records,it not move next 200 records form 10000 records
SQL
select Top (200) DocumentName, [Document], Path, Version,SWF from FTRepository where ([SWF] IS NULL)


So how to solve this.

And second question

I have more that 10000 records in FTRepository table,in that i need to retrieve first 200 records,after process with first 200 records,then need to move next 200 records,and then next 200 records and so on,i mean in more than 10000 records i will spilt 200,200 ... records and process with 200 records and so on...
Here no need where condition (SWF is null),just i need to take 200,200..... records form more than 10000 records.



Records
Araind
Posted

1 solution

an index on the SWF column would probably help - ~10k rows is not a lot ...

SQLServer2012 has the OFFSET/FETCH[^] keywords for pagination like that, failing that google for SQL Pagination methods[^]
 
Share this answer
 
Comments
Aravindba 9-Apr-15 4:39am    
5+,thanks it work,i have another problem,i save 600 mb file in sql server as binary format in one column,if i use select query in vb cde it show timeout expiry,if i use
facon.ConnectionTimeout = 180 it show error like "Property 'ConnectionTimeout' is 'ReadOnly'. "if i manually select in sql server that column and after that column all show "Unable to read data"
barneyman 9-Apr-15 19:28pm    
600mb is a HUGE binary to hold in SQL as a single blob - either cut it up into sections in the DB (and join it back up at the client) or look at FILESTREAM

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900