SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


SET Options - 1


SET Options - 1

Author
Message
ronmoses
ronmoses
SSCrazy
SSCrazy (2.6K reputation)SSCrazy (2.6K reputation)SSCrazy (2.6K reputation)SSCrazy (2.6K reputation)SSCrazy (2.6K reputation)SSCrazy (2.6K reputation)SSCrazy (2.6K reputation)SSCrazy (2.6K reputation)

Group: General Forum Members
Points: 2616 Visits: 1023
Toreador (12/14/2012)
Thanks for the easy question to end the week!

;-)


Hey, what did I tell you??!!! >>>SMACK<<<

:-D

ron

-----
a haiku...

NULL is not zero
NULL is not an empty string
NULL is the unknown

Revenant
Revenant
SSC-Insane
SSC-Insane (22K reputation)SSC-Insane (22K reputation)SSC-Insane (22K reputation)SSC-Insane (22K reputation)SSC-Insane (22K reputation)SSC-Insane (22K reputation)SSC-Insane (22K reputation)SSC-Insane (22K reputation)

Group: General Forum Members
Points: 22455 Visits: 5135
Ron, you made me scratch my head a lot... Thanks!
Ken Wymore
Ken Wymore
SSCrazy Eights
SSCrazy Eights (9.6K reputation)SSCrazy Eights (9.6K reputation)SSCrazy Eights (9.6K reputation)SSCrazy Eights (9.6K reputation)SSCrazy Eights (9.6K reputation)SSCrazy Eights (9.6K reputation)SSCrazy Eights (9.6K reputation)SSCrazy Eights (9.6K reputation)

Group: General Forum Members
Points: 9612 Visits: 2470
Nice question.
SanDroid
SanDroid
SSCarpal Tunnel
SSCarpal Tunnel (4.6K reputation)SSCarpal Tunnel (4.6K reputation)SSCarpal Tunnel (4.6K reputation)SSCarpal Tunnel (4.6K reputation)SSCarpal Tunnel (4.6K reputation)SSCarpal Tunnel (4.6K reputation)SSCarpal Tunnel (4.6K reputation)SSCarpal Tunnel (4.6K reputation)

Group: General Forum Members
Points: 4636 Visits: 1046
Hugo Kornelis (12/14/2012) -
The reason for this limitation? (Puts on speculative hat) Many settings are discouraged anyway, and I guess that MS decided not to put in extra engineering effort to support and test indexed views (and several other features with similar limitations) under all those settings. So they simply forbid them.


Now I understand why speculation is considered a negative speech pattern.
Hugo, If you take a look at the SQL documentation the reason is clear.

Even if an expression is deterministic, if it contains float expressions, the exact result may depend on the processor architecture or version of microcode. To ensure data integrity, such expressions can participate only as non-key columns of indexed views. Deterministic expressions that do not contain float expressions are called precise. Only precise deterministic expressions can participate in key columns and in WHERE or GROUP BY clauses of indexed views.


How would the database engine test the values of an indexed view for the right data percision when executing or running the TSQL from a client if that client connection has the SET option ARITHABORT turned ON?

Apparently this has nothing to do with the testing practices of MS Engineers. :-P
More likely it is the testing done by the Database Engine to data and columns that are to be included in the indexed view.
In this specific example it is the testing of the data being inserted into a column that is participating in the indexed view.
All of the above need to check the percision of the Data Types and that requires SET ARITHABORT OFF and several other OFF
When creating and manipulating indexes on computed columns or indexed views, the SET options ARITHABORT, CONCAT_NULL_YIELDS_NULL, QUOTED_IDENTIFIER, ANSI_NULLS, ANSI_PADDING, and ANSI_WARNINGS must be set to ON. The option NUMERIC_ROUNDABORT must be set to OFF.
If any of these options are not set to the required values, INSERT, UPDATE, and DELETE actions on indexed views or tables with indexes on computed columns will fail. SQL Server will raise an error listing all the options that are incorrectly set. Also, SQL Server will process SELECT statements on these tables or indexed views as though the indexes on computed columns or on the views do not exist.

http://msdn.microsoft.com/en-us/library/aa259205(v=sql.80).aspx
Like my grandfather always said; "You are served better by knowing how to read than how to write." Cool
Tom Thomson
Tom Thomson
SSC Guru
SSC Guru (50K reputation)SSC Guru (50K reputation)SSC Guru (50K reputation)SSC Guru (50K reputation)SSC Guru (50K reputation)SSC Guru (50K reputation)SSC Guru (50K reputation)SSC Guru (50K reputation)

Group: General Forum Members
Points: 50682 Visits: 13159
Excellent question.

Tom

john.arnott
john.arnott
SSCertifiable
SSCertifiable (7.1K reputation)SSCertifiable (7.1K reputation)SSCertifiable (7.1K reputation)SSCertifiable (7.1K reputation)SSCertifiable (7.1K reputation)SSCertifiable (7.1K reputation)SSCertifiable (7.1K reputation)SSCertifiable (7.1K reputation)

Group: General Forum Members
Points: 7074 Visits: 3059
SanDroid, your explanation has me puzzled. The first quote says that one cannot use an expression containing a float expression in the key column of an indexed view. By itself, this would appear not to apply to the QOD situation where the index is based on an INT column. How then is this a clear explanation for prohibiting the use of an index on a view if Numeric_RoundAbort is On? Wouldn't that setting only affect the evaluation of an expression that depended on a float or other expression that's not strictly deterministic at the lowest (machine) level?

The second part of your explanation didn't help me any more than the first. You pose an apparently rhetorical question, "How would the database engine test the values of an indexed view for the right data percision when executing or running the TSQL from a client if that client connection has the SET option ARITHABORT turned ON?" I don't follow why that setting (or NUMERIC_ROUNDABORT turned OFF as I think you may have meant) would affect what the engine would do with an INT column.

Your final paragraph actually echoes Hugo when you say it seems likely the engine would have to test the absolute deterministic characteristics of all components of the view index. If I may take that thought forward, wouldn't that mean the engine instead just says "if NUMERIC_ROUNDABORT is OFF, then non-deterministic values COULD be there, and I don't want to go looking for that possibility deep down inside". This would be how I understood Hugo's speculation, back where we started. Can this be cleared up WITHOUT speculation?
Keld Laursen (SEGES)
Keld Laursen (SEGES)
Mr or Mrs. 500
Mr or Mrs. 500 (579 reputation)Mr or Mrs. 500 (579 reputation)Mr or Mrs. 500 (579 reputation)Mr or Mrs. 500 (579 reputation)Mr or Mrs. 500 (579 reputation)Mr or Mrs. 500 (579 reputation)Mr or Mrs. 500 (579 reputation)Mr or Mrs. 500 (579 reputation)

Group: General Forum Members
Points: 579 Visits: 214
Argh!

I did read the docs, but I got too focused on the index creation itself, which will fail if numeric_roundabort is on, but the info on update/insert etc. didn't really sink in.

Thank you for the question.
DavidBridgeTechnology.com
DavidBridgeTechnology.com
Old Hand
Old Hand (353 reputation)Old Hand (353 reputation)Old Hand (353 reputation)Old Hand (353 reputation)Old Hand (353 reputation)Old Hand (353 reputation)Old Hand (353 reputation)Old Hand (353 reputation)

Group: General Forum Members
Points: 353 Visits: 238
I love indexed views

Actually I hate indexed views
Actually I love indexed views
Actually I hate indexed views
Actually I love indexed views
Actually I hate indexed views
Actually I love indexed views
Actually I hate indexed views
Actually I love indexed views

etc etc etc.

Actually, they are good sometimes but seldom worth the effort :-)

David Bridge
David Bridge Technology Limited
www.davidbridgetechnology.com
kalyani.k478
kalyani.k478
SSC Eights!
SSC Eights! (970 reputation)SSC Eights! (970 reputation)SSC Eights! (970 reputation)SSC Eights! (970 reputation)SSC Eights! (970 reputation)SSC Eights! (970 reputation)SSC Eights! (970 reputation)SSC Eights! (970 reputation)

Group: General Forum Members
Points: 970 Visits: 97
Learnt something new...
Paul White
Paul White
SSC Guru
SSC Guru (79K reputation)SSC Guru (79K reputation)SSC Guru (79K reputation)SSC Guru (79K reputation)SSC Guru (79K reputation)SSC Guru (79K reputation)SSC Guru (79K reputation)SSC Guru (79K reputation)

Group: General Forum Members
Points: 79734 Visits: 11400
john.arnott (12/15/2012)
SanDroid, your explanation has me puzzled. The first quote says that one cannot use an expression containing a float expression in the key column of an indexed view. By itself, this would appear not to apply to the QOD situation where the index is based on an INT column. How then is this a clear explanation for prohibiting the use of an index on a view if Numeric_RoundAbort is On? Wouldn't that setting only affect the evaluation of an expression that depended on a float or other expression that's not strictly deterministic at the lowest (machine) level?

The second part of your explanation didn't help me any more than the first. You pose an apparently rhetorical question, "How would the database engine test the values of an indexed view for the right data percision when executing or running the TSQL from a client if that client connection has the SET option ARITHABORT turned ON?" I don't follow why that setting (or NUMERIC_ROUNDABORT turned OFF as I think you may have meant) would affect what the engine would do with an INT column.

Your final paragraph actually echoes Hugo when you say it seems likely the engine would have to test the absolute deterministic characteristics of all components of the view index. If I may take that thought forward, wouldn't that mean the engine instead just says "if NUMERIC_ROUNDABORT is OFF, then non-deterministic values COULD be there, and I don't want to go looking for that possibility deep down inside". This would be how I understood Hugo's speculation, back where we started. Can this be cleared up WITHOUT speculation?

Thanks for writing this so I didn't have to :-)



Paul White
SQLPerformance.com
SQLblog.com
@SQL_Kiwi
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum








































































































































































SQLServerCentral


Search