tags:

views:

31

answers:

0

I have dropped on this question: SQL query to find Missing sequence numbers. I want to achieve the same thing but with LINQ to SQL.

To recap: I have a table with ids like 1,2,4,5,10,11,12,15, [...]. I want the unused ids 3,6,7,8,9,13,14, [...].

Can we create a temporary sequence and use the same logic as in T-SQL?

I tried to create a temp array of integers as a temp sequence, it works, but since the ids in the table is going up to 900,000 and more, I don't think it's the optimal way to do this.