Roger Lipscombe
Roger Lipscombe

Reputation: 91825

Please explain the SET Option Requirements for computed columns

Creating Indexes on Computed Columns contains a list of six SET options that must be ON and one that must be OFF when using computed columns in an index.

Why must they be set this way?

Upvotes: 3

Views: 125

Answers (2)

Damien_The_Unbeliever
Damien_The_Unbeliever

Reputation: 239646

Because you dont want computed columns to be any more expensive than possible, and would you rather have one, tightly written and tested code path responsible for them, or 128 different code paths (2^7 combinations of options).

They allow the developers of this code to just assume these things are so.

Upvotes: 1

Frank Kalis
Frank Kalis

Reputation: 1352

Hm, do you need any more reasons apart from that SQL Server requires them for the statement to succeed? :-)

No, seriously. Because different SET options can affect the result, I guess they must be set this way to ensure that all connections do see the same computed values.

Upvotes: 0

Related Questions