April 6, 2004 at 11:50 pm
Hi! What SET options to use and with what settings (ON/OFF) when creating the indexed views? The problem is that after the view is created all add/update/delete queries to any table crash with the message 'SET options have incorrect settings: ANSI_NULLS, QUOTED_IDENTIFIER, ARITHABORT'
April 7, 2004 at 2:10 am
Hi,
Well there is enough information in BOL and the Primary requirement for creating a indexed view is
Please refer to Creating an Indexed View in BOL
Thanks
Prasad Bhogadi
www.inforaise.com
April 8, 2004 at 5:32 am
When I did this I made a change to the user options so that all connections would be made with ArithAbort on as by default the connections were made with this off. This can be done through QA using:
exec sp_configure 'show advanced options',1
reconfigure
exec sp_configure 'user options', 64
reconfigure
exec sp_configure 'show advanced options', 0
This has to be set when doing any insert/update or delete of the data. It caused me major headaches trying to troubleshoot a proc that was not working, only to find out that when the proc was created (before the indexed view) the ANSI_NULLS value was set incorrectly, recreating the proc the correct way resolved this....
From BOL:
The first index created on a view must be a unique clustered index. After the unique clustered index has been created, you can create additional nonclustered indexes. The naming conventions for indexes on views are the same as for indexes on tables. The only difference is that the table name is replaced with a view name. For more information, see CREATE INDEX.
The CREATE INDEX statement must meet these requirements in addition to the normal CREATE INDEX requirements:
After the clustered index is created, any connection attempting to modify the base data for the view must also have the same option settings required to create the index. SQL Server generates an error and rolls back any INSERT, UPDATE, or DELETE statement that will affect the result set of the view if the connection executing the statement does not have the proper option settings. For more information, see SET Options That Affect Results.
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply