Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

URGENT: RS don't use indexed views?????

0 views
Skip to first unread message

Jéjé

unread,
Jun 21, 2004, 9:35:48 AM6/21/04
to
Hi,

I've a query on a "big" table.
I've optimized this query, and SQL Server as created an indexed view.
So my query takes 2 seconds instead-of 20 seconds.

But, when I execute this query through a report, so in reporting services,
then the query don't use the indexed view!!!!

Any idea of what's appens?
I know I can change my query to insure I'm using the indexed view, but it's
not an elegant solution.

Thanks.

Jerome.


Jeff Davis

unread,
Jun 21, 2004, 1:20:42 PM6/21/04
to
One possibility you may want to look at would be that the connection
parameters are different when RS is running your query. If certain
connection options are not set correctly then SQL Server will just not use
any indexed views that might be present. SELECT statements will silently
ignore the presence of indexed views and update statements will fail with an
error. You may try hard-coding the correct connection parameters in your
query or stored proc to make sure your indexed view can be used.

Here's an article on this subject from BOL:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/createdb/cm_8_des_05_1ng3.asp


Jeff Davis

"Jéjé" <willgart@_A_hAotmail_A_.com> wrote in message
news:eKf7MS5V...@TK2MSFTNGP09.phx.gbl...

Jéjé

unread,
Jun 21, 2004, 2:32:00 PM6/21/04
to
Well,
I've created a SP to produce the same result, this SP executed in the query
analyzer works fine and use the indexed view, but through RS I've always the
same problem!!!

The result is the same through Visual studio or through the published
version of the report.
Can I activate anything in my conenctionstring ?
My current connection:
data source=.;initial catalog=MyDatabase
(With NT Authentication enable)

Or I've to set some option in my SP?

"Jeff Davis" <jeff....@tamtron.nospam.com.invalid> a écrit dans le message
de news:eRH2iQ7V...@tk2msftngp13.phx.gbl...

Jéjé

unread,
Jun 21, 2004, 2:35:07 PM6/21/04
to
oups, its ok, in the article, there is a line about the SET ARITHABORT
option which is set to off for OLEDB for ODBC connection.
So my SP now set this option to ON and all works fine!!!


"Jeff Davis" <jeff....@tamtron.nospam.com.invalid> a écrit dans le message
de news:eRH2iQ7V...@tk2msftngp13.phx.gbl...

0 new messages