AARG! Indexed Views

  • Boy, I got myself in some trouble. I ran the Index Tuning Wizard on a query, and it recommended to add a bunch of indexes, two of them were on views. I, in my infinite wisdom, failed to save the script or jot down the names of the changed tables and views. Lesson Learned. I have never indexed a view before, so SQL 2000 is not set up for it.

    OK, now for the problem. I have 2 jobs that run update and insert TSQL commands into two tables. If I run them in the job, I get an 'QUOTED_IDENTIFIER, ARITHABORT'. [SQLSTATE 42000] (Error 1934)' error. If I run them in SQL Query Analyzer, they run successfully.

    I have searched every view using the Query Analyzer, and I cannot find the indexed views. I see a new view called '_hypmv-4', which references both of the tables that are failing the job update. I assume it is the index.

    I humbly lay myself at the feet of the SQL Gods in this forum for help. Are indexed views too complicated to set up for basic operations? My DB is rather simple, and I probably do not need the index at all. How do I get the job to run successfully? Or how do I find the indexed views? Or how do I get rid of the d__m thing?

    Thanks for ANY help y'all can give!

    Michael Lee


    Shalom!,

    Michael Lee

  • Basically you need to have the same set options on the table and on the view... While I can't really help you on that because I never investigated this problem, I can show you how to find the views that are causing you trouble :

    Select O.Name as ViewName, I.Name as IdxName from dbo.SysObjects O inner join dbo.SysIndexes I on O.id = i.id and O.XType = 'V'

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply