Max number of tables (objects) in SQL Server editions (compact, express)

6.1k Views Asked by At

What are the maximum number of tables that you can have in:

  • SQL CE4
  • SQL 2008 R2 Express

Numbers here http://msdn.microsoft.com/en-us/library/ms143432.aspx I guess is for SQL Server 2008, but are they valid for Express and what about SQL CE4?

The sum of the number of all objects in a database cannot exceed 2,147,483,647

BTW. Sorry for duplicating questions, but it seems to me Stackoverflow is providing answers more quickly.

3

There are 3 best solutions below

0
On BEST ANSWER

No word about CE, but Express is normal SQL Server + database size and memory / processr limitations.... If you can fit yoru tables into the size, the normal SQL Server limity apply.

0
On

For SQLCe4, I got the response:

There is no limit on number of tables, but we do have a limit of 4GB file size.

7
On

SQL Server Compact 3.5 limitations here: http://msdn.microsoft.com/en-us/library/ms172451%28v=SQL.105%29.aspx but that only points out 1024 columns per table and no specific table limitation.

SQL Server Express is the same as normal SQL Server as TomTom points out, it's just limited by memory, processor and database size, the limits of SQL Server Express edition are:

  • Constrained to a single CPU
  • 1GB RAM
  • 10GB database size (4GB in versions before SQL 2008 R2 Express)

Otherwise express edition is standard, this is to allow databases to be moved to and from SQL Server Standard to SQL Server Express, which helps in system development. So for SQL Express it's still The sum of the number of all objects in a database cannot exceed 2,147,483,647

As I said in a comment, if you're doing anything that gets close to hitting these numbers you should really look at your DB design process, if they're being automatically generated then consider not partitioning into so many tables.

By this I mean that you should be selecting your SQL Server version based on other requirements, if suppose SQL CE is limited to 256 tables (not saying that it does since I can find no such thing, and it's much more likely to be at least past 1024), and say you need 500 tables. Then either look at denormalizing some of your tables, or at that point you really need to upgrade to including SQL Express with your program (this just complicates your software deployment process, and not a lot more).

I don't have SQL CE avail atm, but the easiest way would be to just have a test go run off and generate 10k create table statements, with each table having 20+ columns. If your requirements are greater than that then just use numbers that you know.

Lastly, there's SQLite which you haven't asked about, again there's no documentation on this but I suspect it's likely 64k+ you're limited to only 64 tables in a join though.