Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7707155
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T00:17:19+00:00 2026-06-01T00:17:19+00:00

I will be having a table in SQL Server 2008 that will hold millions

  • 0

I will be having a table in SQL Server 2008 that will hold millions of rows and the initial design will be:

Code nvarchar(50) PK
Available bit
validUntil DateTime
ImportID int

The users can import 100,000 odd codes at a time which I will be using sqlbulkcopy to insert the data. They can also request batches of codes of up to 10,000 at a time for a specific ImportID and as long as the request date is less than the ValidUntil date and the code is available.

My question is, will it be better to hold all these codes in the one table and use indexes or to split the one table into two – AvailableCodes and UsedCodes – so whenever codes are requested, they are moved from the AvailableCodes table into the UsedCodes table instead of having the Available flag? That way the AvailableCodes table won’t get as massive as a single table as over time there will be more used codes than available codes and I will not be that bothered about them accept for auditing purposes.

Also, if the tables are split will I still be able to use the sqlbulkcopy as the codes will still need to be unique across both tables?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T00:17:21+00:00Added an answer on June 1, 2026 at 12:17 am

    I would create it in one table and create well defined indexes.

    Consider a filter index for the flag column. This is done with a where clause in t-sql and the filter page in ssms.

    http://msdn.microsoft.com/en-us/library/cc280372.aspx

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

To my knowledge SQL Server 2008 will only allow one clustered index per table.
Consider the following table in SQL Server 2008: LanguageCode varchar(10) Language nvarchar(50) LanguageCode participates
I also have a very large table in SQL Server (2008 R2 Developer Edition)
I'm having problems using Hibernate and SQL Server 2008. When I try to save
I'm having some fun trying to pick a decent SQL Server 2008 spatial index
I am having a table in SQL server which stores MINIMUM_AMOUNT, MAXIMUM_AMOUNT and CURRENCY_ID.
I am having an minor problem using sql server 2008. When I go for
I'm having some trouble with a SQL Server 2008 R2 (Express) installation. It seems
In SQL Server 2008, I have below Table Sample. Name Num ---------- John 20
SQL Server 2008: I'm having a tough time translating my pseudo SQL to actual

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.