SQL Async Multiple Queries Combine Results — Maximum Results (Top XYZ)

后端 未结 4 1547
忘了有多久
忘了有多久 2021-01-26 08:47

I have a search function set up, where I run multiple queries simultaneously. The top 1000 results of each query are written to a table. (These run async--I am just leaving out

4条回答
  •  囚心锁ツ
    2021-01-26 08:55

    insert into #tt2 
    SELECT TOP 1000 [sID]
    FROM [docSVsys]
    where (select count(*) from #tt2) < 1000
    

    But I would still use .NET and TPL.

    This will still process all tables but it should process 0 rows once it gets to 1000

提交回复
热议问题