views:

31

answers:

1

I've got a database View in SQL Server 2008 and when I run it from Query Analyser, it runs within a couple of seconds. When I run it in Excel 2007, it loads the data just fine. But when I run it in Word 2007 on a mail merge, it just seems to take a very long time to run (literally minutes to run).

If anyone has an idea how to solve this, could they let me know?

+3  A: 

SQL 2008 will allow you to run a Profiler trace on the query. Start the trace before you kick off the Word query and see how long it takes. My guess is it's the mail-merge that's slow.

If it were slow in Excel too, you'd be looking at your indexes.

Randolph Potter
Thanks for the reply, Randolph.I tried that and found that it Word sets ARITHABORT off, which I know causes problems with index views. I'm now trying to find a way around this.
Tim Almond
Luckily you can set that using a stored procedure *hint hint* :-)
Randolph Potter
Thanks Radolph. Yes, indeed. The client has views which are autogenerated (complicated to explain) and another piece of software which may not support SPs. I'm going to dig deeper into all that.Thanks for all your ideas.
Tim Almond
Glad I could help.
Randolph Potter