Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

I have plan to create 3000 tables for my database. But I am afraid how will I retrieve some data from those many tables.

Eg:

Select * 
from table1, table2, table3.... table3000 
where colmn='somevalue';

I can't type the names of all tables in the FROM clause.

Is it possible to work with those many tables in SQL ? If not which DB will be the best to work with those many tables ?

Please help. Thanks in advance.

share|improve this question

closed as unclear what you're asking by Jon Seigel, Mark Storey-Smith, RolandoMySQLDBA, bluefeet, StanleyJohns Sep 13 '13 at 0:45

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question.If this question can be reworded to fit the rules in the help center, please edit the question.

13  
Why, why, why are you creating 3000 tables that seem to model the same data? –  Aaron Bertrand Sep 12 '13 at 20:30
4  
I agree with Aaron. Why would you want to do that? It sounds as if your data model is completely wrong. –  a_horse_with_no_name Sep 12 '13 at 20:39
2  
Are you trying to do some form of partitioning, but are not aware of it? But still, 3000 is too much. –  StanleyJohns Sep 13 '13 at 0:45
add comment

1 Answer 1

Is it possible to work with those many tables in SQL?

Yes, it is: http://msdn.microsoft.com/en-us/library/ms143432.aspx

The number of tables allowed in a SELECT query is limited only by available resources.

share|improve this answer
3  
The question is tagged oracle, not sql-server –  a_horse_with_no_name Sep 12 '13 at 20:36
2  
@a_horse_with_no_name But the question also asks "if not which DB will be the best to work with those many tables ?" Best of course being subjective... –  billinkc Sep 12 '13 at 20:41
    
@billinkc Pedantic note. SQLRockstar has not provided any evidence though about the if not part. Shall we assume that he claims Oracle cannot handle that number of tables? –  ypercube Sep 12 '13 at 21:15
3  
It seems to be possible in Oracle: asktom.oracle.com/pls/asktom/… –  Sebastian Meine Sep 12 '13 at 21:31
add comment

Not the answer you're looking for? Browse other questions tagged or ask your own question.