From: Robin9876 on
When running the DB Tuning Advisor on a SQL 2005 database that has a
stored procedure with parameters and the SQL for that SP in the tuning
advisor it shows CategoryID S001, Statement does not reference any
tables.

Why is it not detecting any tables and how can I correct this?
From: Aaron Bertrand [SQL Server MVP] on
What database(s) did you select for the Tuning Advisor to look at? What
does the stored procedure code look like? It'd be fun to guess about these
things, but probably not so much for you.


On 9/18/08 12:10 PM, in article
9634e5bc-4141-47cc-8555-287e429aeb89(a)l43g2000hsh.googlegroups.com,
"Robin9876" <robin9876(a)hotmail.com> wrote:

> When running the DB Tuning Advisor on a SQL 2005 database that has a
> stored procedure with parameters and the SQL for that SP in the tuning
> advisor it shows CategoryID S001, Statement does not reference any
> tables.
>
> Why is it not detecting any tables and how can I correct this?

From: Robin9876 on
I used a trace file that I had captured which had a Stored Procedure
which has 5 parameters, the SQL has a view (union of two tables) which
the view is joined to a few other tables.

I also copied the SQL out form the SP and ran that with the same
parameters but it returned the same message.


On 18 Sep, 17:48, "Aaron Bertrand [SQL Server MVP]"
<ten....(a)dnartreb.noraa> wrote:
> What database(s) did you select for the Tuning Advisor to look at?  What
> does the stored procedure code look like?  It'd be fun to guess about these
> things, but probably not so much for you.
>
> On 9/18/08 12:10 PM, in article
> 9634e5bc-4141-47cc-8555-287e429ae...(a)l43g2000hsh.googlegroups.com,
>
> "Robin9876" <robin9...(a)hotmail.com> wrote:
> > When running the DB Tuning Advisor on a SQL 2005 database that has a
> > stored procedure with parameters and the SQL for that SP in the tuning
> > advisor it shows CategoryID S001, Statement does not reference any
> > tables.
>
> > Why is it not detecting any tables and how can I correct this?

From: Aaron Bertrand [SQL Server MVP] on
And you are are sure that all tables are in the same database? And I'll ask
again, what database(s) did you select for the Tuning Advisor to look at?


On 9/18/08 4:02 PM, in article
eb5e6b21-8e2f-4b88-924a-dda55f729da3(a)q5g2000prf.googlegroups.com,
"Robin9876" <robin9876(a)hotmail.com> wrote:

> I used a trace file that I had captured which had a Stored Procedure
> which has 5 parameters, the SQL has a view (union of two tables) which
> the view is joined to a few other tables.
>
> I also copied the SQL out form the SP and ran that with the same
> parameters but it returned the same message.
>
>
> On 18 Sep, 17:48, "Aaron Bertrand [SQL Server MVP]"
> <ten....(a)dnartreb.noraa> wrote:
>> What database(s) did you select for the Tuning Advisor to look at? �What
>> does the stored procedure code look like? �It'd be fun to guess about these
>> things, but probably not so much for you.
>>
>> On 9/18/08 12:10 PM, in article
>> 9634e5bc-4141-47cc-8555-287e429ae...(a)l43g2000hsh.googlegroups.com,
>>
>> "Robin9876" <robin9...(a)hotmail.com> wrote:
>>> When running the DB Tuning Advisor on a SQL 2005 database that has a
>>> stored procedure with parameters and the SQL for that SP in the tuning
>>> advisor it shows CategoryID S001, Statement does not reference any
>>> tables.
>>
>>> Why is it not detecting any tables and how can I correct this?
>

From: Robin9876 on
The database is a database that I have created.

I found that the problem was I was using the standard template and not
the tracing template. Although the other template did seem to have the
types of statement the tuning advisor required.

On 18 Sep, 21:27, "Aaron Bertrand [SQL Server MVP]"
<ten....(a)dnartreb.noraa> wrote:
> And you are are sure that all tables are in the same database?  And I'll ask
> again, what database(s) did you select for the Tuning Advisor to look at?
>
> On 9/18/08 4:02 PM, in article
> eb5e6b21-8e2f-4b88-924a-dda55f729...(a)q5g2000prf.googlegroups.com,
>
> "Robin9876" <robin9...(a)hotmail.com> wrote:
> > I used a trace file that I had captured which had a Stored Procedure
> > which has 5 parameters, the SQL has a view (union of two tables) which
> > the view is joined to a few other tables.
>
> > I also copied the SQL out form the SP and ran that with the same
> > parameters but it returned the same message.
>
> > On 18 Sep, 17:48, "Aaron Bertrand [SQL Server MVP]"
> > <ten....(a)dnartreb.noraa> wrote:
> >> What database(s) did you select for the Tuning Advisor to look at?  What
> >> does the stored procedure code look like?  It'd be fun to guess about these
> >> things, but probably not so much for you.
>
> >> On 9/18/08 12:10 PM, in article
> >> 9634e5bc-4141-47cc-8555-287e429ae...(a)l43g2000hsh.googlegroups.com,
>
> >> "Robin9876" <robin9...(a)hotmail.com> wrote:
> >>> When running the DB Tuning Advisor on a SQL 2005 database that has a
> >>> stored procedure with parameters and the SQL for that SP in the tuning
> >>> advisor it shows CategoryID S001, Statement does not reference any
> >>> tables.
>
> >>> Why is it not detecting any tables and how can I correct this?