A Select statement is limited to 260 tables. Tables included in nested view
s
and UDF's are included in the table total. Is there an easy way to determin
e
how many tables a Select statement is currently using? For example, I'd lik
e
to know if sproc X is currently at 259 tables.Wow,Dave do you reall deal with 260tables within a single SP?
> and UDF's are included in the table total. Is there an easy way to
> determine
> how many tables a Select statement is currently using?
No , that I'm aware
"Dave" <Dave@.discussions.microsoft.com> wrote in message
news:93191E1B-B7F6-4B85-9930-233CE6345555@.microsoft.com...
>A Select statement is limited to 260 tables. Tables included in nested
>views
> and UDF's are included in the table total. Is there an easy way to
> determine
> how many tables a Select statement is currently using? For example, I'd
> like
> to know if sproc X is currently at 259 tables.|||Hi Dave
There is no easy way of doing this, even if sysdepends was reliable, you
could not differentiate between different statements in your
procedure/function.
The question you would have to ask is why does your design reach this limit?
John
"Dave" wrote:
> A Select statement is limited to 260 tables. Tables included in nested vi
ews
> and UDF's are included in the table total. Is there an easy way to determ
ine
> how many tables a Select statement is currently using? For example, I'd l
ike
> to know if sproc X is currently at 259 tables.|||I've seen partitioned views that unionize more than 100 tables, but never a
single select with that many joins. This imposed 260 table limit is
basically a sanity constraint and there for the safety of yourself and
others.
"Dave" <Dave@.discussions.microsoft.com> wrote in message
news:93191E1B-B7F6-4B85-9930-233CE6345555@.microsoft.com...
>A Select statement is limited to 260 tables. Tables included in nested
>views
> and UDF's are included in the table total. Is there an easy way to
> determine
> how many tables a Select statement is currently using? For example, I'd
> like
> to know if sproc X is currently at 259 tables.|||> Is there an easy way to determine
> how many tables a Select statement is currently using?
Being someone who has reached this limit once or twice, I understand
your concern. If this limit is a "sanity constraint", it would be good
to know how "sane" are we, regarding a particular statement.
I found a method to aproximate the number (the real number may be a bit
higher): issue a SET SHOWPLAN_ALL ON before executing the SELECT (in
Query Analyzer / Management Studio), then count the number of rows
where the Argument column begins with "OBJECT:" (you can do this by
copying the result to Excel, for example). This number can be smaller
than the real number of tables, because the query plan is already
optimized (so it doesn't show the tables that are present in the
statement or the views, but are unnecessary for returning the specified
columns).
Razvan
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment