Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


SET Options - 1


SET Options - 1

Author
Message
ronmoses
ronmoses
Ten Centuries
Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)

Group: General Forum Members
Points: 1095 Visits: 996
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
SSCertifiable
SSCertifiable (5.8K reputation)SSCertifiable (5.8K reputation)SSCertifiable (5.8K reputation)SSCertifiable (5.8K reputation)SSCertifiable (5.8K reputation)SSCertifiable (5.8K reputation)SSCertifiable (5.8K reputation)SSCertifiable (5.8K reputation)

Group: General Forum Members
Points: 5829 Visits: 4720
Ron, you made me scratch my head a lot... Thanks!
Ken Wymore
Ken Wymore
SSCarpal Tunnel
SSCarpal Tunnel (4.5K reputation)SSCarpal Tunnel (4.5K reputation)SSCarpal Tunnel (4.5K reputation)SSCarpal Tunnel (4.5K reputation)SSCarpal Tunnel (4.5K reputation)SSCarpal Tunnel (4.5K reputation)SSCarpal Tunnel (4.5K reputation)SSCarpal Tunnel (4.5K reputation)

Group: General Forum Members
Points: 4452 Visits: 2343
Nice question.
SanDroid
SanDroid
Ten Centuries
Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)

Group: General Forum Members
Points: 1414 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
TomThomson
TomThomson
SSChampion
SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)

Group: General Forum Members
Points: 10769 Visits: 12019
Excellent question.

Tom

john.arnott
john.arnott
UDP Broadcaster
UDP Broadcaster (1.5K reputation)UDP Broadcaster (1.5K reputation)UDP Broadcaster (1.5K reputation)UDP Broadcaster (1.5K reputation)UDP Broadcaster (1.5K reputation)UDP Broadcaster (1.5K reputation)UDP Broadcaster (1.5K reputation)UDP Broadcaster (1.5K reputation)

Group: General Forum Members
Points: 1474 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)
Old Hand
Old Hand (338 reputation)Old Hand (338 reputation)Old Hand (338 reputation)Old Hand (338 reputation)Old Hand (338 reputation)Old Hand (338 reputation)Old Hand (338 reputation)Old Hand (338 reputation)

Group: General Forum Members
Points: 338 Visits: 202
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
SSC Journeyman
SSC Journeyman (85 reputation)SSC Journeyman (85 reputation)SSC Journeyman (85 reputation)SSC Journeyman (85 reputation)SSC Journeyman (85 reputation)SSC Journeyman (85 reputation)SSC Journeyman (85 reputation)SSC Journeyman (85 reputation)

Group: General Forum Members
Points: 85 Visits: 234
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
SSChasing Mays
SSChasing Mays (638 reputation)SSChasing Mays (638 reputation)SSChasing Mays (638 reputation)SSChasing Mays (638 reputation)SSChasing Mays (638 reputation)SSChasing Mays (638 reputation)SSChasing Mays (638 reputation)SSChasing Mays (638 reputation)

Group: General Forum Members
Points: 638 Visits: 97
Learnt something new...
Paul White
Paul White
SSChampion
SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)

Group: General Forum Members
Points: 10352 Visits: 11350
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