I am trying to find the best, quickest and most efficient way to determine if a number has been seen in a range.

**Example:**
Key for record: Raffle Event 1 (database key)

Tickets Available: 1 - 1000000 (the range)

Ticket number 4 was turned in. Has it been turned in already for this event?

Ticket number 865401 was turned in. Has it been turned in already for this event?

I've thought about bit masks, storing data as buckets, etc. But none of these seem to be the answer I am trying to find. Maybe it does not exist. 

We have 800,000 events, each event with 1 million tickets. We are currently storing the last number turned in, and anything lower is rejected. We want to have finer granularity, but need efficiency and storing each ticket would be impractical. 

Data is stored using SQL

Any ideas?

**EDIT**

The best idea I've come up with so far is using a bitmap. Have 10 columns for each event. Each column stores 100,000 bits. This should allow for quick data retrieval, then just check if the bit is on or off. This should be about 1mb of storage per event, or 100k per column read. 

I'm still searching for alternative ideas or recommendations.