472,340 Members | 1,869 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,340 software developers and data experts.

256 table limit for partitioned views

I have a partitioned view sitting over several tables and I'm slowly
approaching the 256 number. Can anybody confirm if there is such a
limit for the maximum number of tables that a partitioned view can
hold?

If this is true, does anybody have any suggestions or ideas to work
around this max limit?

TIA!

Aug 8 '05 #1
4 3419
karthik (ka***********@gmail.com) writes:
I have a partitioned view sitting over several tables and I'm slowly
approaching the 256 number. Can anybody confirm if there is such a
limit for the maximum number of tables that a partitioned view can
hold?
Yes, since the maximum number of tables per query is 256 I would
expect that there is such a limit.
If this is true, does anybody have any suggestions or ideas to work
around this max limit?


How big are your tables? Would it be possible to consolidate them?

In SQL 2005 there is partioned tables, which is taking this to another
level. I don't know how many partitions you can have in a table, but
it's a new ballpark.
--
Erland Sommarskog, SQL Server MVP, es****@sommarskog.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinf...2000/books.asp

Aug 8 '05 #2
The limit is 256 tables "per SELECT statement", not per query.
Therefore, a UNION query can have more than 256 tables, but
unfortunately, such a query may not be used in a view. For example:

CREATE TABLE T (X INT)
INSERT INTO T VALUES (1)
DECLARE @SQL varchar(8000)

SELECT @SQL=ISNULL(@SQL+' UNION ALL ','')+'SELECT X FROM T'
FROM (SELECT DISTINCT number FROM master..spt_values
WHERE number BETWEEN 0 AND 256) X

--PRINT LEN(@SQL)
EXEC(@SQL)

SET @SQL='CREATE VIEW V AS '+@SQL
EXEC (@SQL)

For more informations, see:
http://groups-beta.google.com/group/...85c192f511bd1a

Razvan

Aug 9 '05 #3
Razvan Socol (rs****@gmail.com) writes:
The limit is 256 tables "per SELECT statement", not per query.
Therefore, a UNION query can have more than 256 tables, but
unfortunately, such a query may not be used in a view. For example:
Thanks Razvan. I did notice "per SELECT statement", but I was too lazy
to get a practical interpretation of what that really meant.
For more informations, see:
http://groups-beta.google.com/group/...85c192f511bd1a


That's a useful link!
--
Erland Sommarskog, SQL Server MVP, es****@sommarskog.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinf...2000/books.asp

Aug 9 '05 #4
Thanks Razvan and Erland....I guess I'm just going to wait for the
Partitioned Tables feature in SQL Server 2005.

Aug 12 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Warren Wright | last post by:
Hello, We maintain a 175 million record database table for our customer. This is an extract of some data collected for them by a third party...
10
by: bsandell | last post by:
I need to write a stored procedure to verify that a table exists and also that the user executing the stored procedure has access to the specified...
8
by: Zero.NULL | last post by:
Hi, We are using Month-year tables to keep the history of long transaction of our application. For example: We capture the details of a...
10
by: Sumanth | last post by:
Hi, I have a table that I would like to partition. It has a column c1 which has 100 distinct values. I was planning to partition the table on...
11
by: steve.keanie | last post by:
Hi ... we're a mainframe V7 shop planning an imminent upgrade to V8. My application team is converting an IMS DB into a DB/2 table ......
15
by: Piero 'Giops' Giorgi | last post by:
Hi! I have a question: I already have a DB that uses partitions to divide data in US Counties, partitioned by state. Can I use TWO levels...
0
by: Damir | last post by:
Hello all! I created a range-partitioned table, and noticed that indexes were created as "NOT PARTITIONED" (through db2look), even though I ran the...
6
by: shawno | last post by:
Hi, We're running DB2 v8.1 on a windows platform and have a database that is quite large. It basically contains one table with a BLOB field...
2
by: eeriehunk | last post by:
Hi All, Is it possible to create a partitioned index on a table which is not partitioned? If so what is such a partition called and please explain?...
0
by: concettolabs | last post by:
In today's business world, businesses are increasingly turning to PowerApps to develop custom business applications. PowerApps is a powerful tool...
0
by: teenabhardwaj | last post by:
How would one discover a valid source for learning news, comfort, and help for engineering designs? Covering through piles of books takes a lot of...
0
by: CD Tom | last post by:
This only shows up in access runtime. When a user select a report from my report menu when they close the report they get a menu I've called Add-ins...
0
by: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge...
0
jalbright99669
by: jalbright99669 | last post by:
Am having a bit of a time with URL Rewrite. I need to incorporate http to https redirect with a reverse proxy. I have the URL Rewrite rules made...
2
by: Matthew3360 | last post by:
Hi, I have a python app that i want to be able to get variables from a php page on my webserver. My python app is on my computer. How would I make it...
0
by: AndyPSV | last post by:
HOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and on my computerHOW CAN I CREATE AN AI with an .executable...
0
by: Arjunsri | last post by:
I have a Redshift database that I need to use as an import data source. I have configured the DSN connection using the server, port, database, and...
0
hi
by: WisdomUfot | last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.