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


Creating indexes on computed columns


Creating indexes on computed columns

Author
Message
Manie Verster
Manie Verster
SSCommitted
SSCommitted (1.8K reputation)SSCommitted (1.8K reputation)SSCommitted (1.8K reputation)SSCommitted (1.8K reputation)SSCommitted (1.8K reputation)SSCommitted (1.8K reputation)SSCommitted (1.8K reputation)SSCommitted (1.8K reputation)

Group: General Forum Members
Points: 1801 Visits: 1022
Comments posted to this topic are about the item Creating indexes on computed columns

:-PManie Verster
Developer
Johannesburg
South Africa

I can do all things through Christ who strengthens me. - Holy Bible
I am a man of fixed and unbending principles, the first of which is to be flexible at all times. - Everett Mckinley Dirkson (Well, I am trying. - Manie Verster)
UMG Developer
UMG Developer
Hall of Fame
Hall of Fame (3K reputation)Hall of Fame (3K reputation)Hall of Fame (3K reputation)Hall of Fame (3K reputation)Hall of Fame (3K reputation)Hall of Fame (3K reputation)Hall of Fame (3K reputation)Hall of Fame (3K reputation)

Group: General Forum Members
Points: 3026 Visits: 2204
I think you need to check the answer key for this question. It lists "Column references can pull data from multiple rows." as one of the options you have to pick, but then in your explanation you say "No column reference pulls data from multiple rows."

And the BOL article you link to says 'No column reference pulls data from multiple rows.", so it seems that "Column references can pull data from multiple rows." is not a correct choice. Either that or you meant for the can to be can't.
Oleg Netchaev
Oleg Netchaev
SSCommitted
SSCommitted (1.9K reputation)SSCommitted (1.9K reputation)SSCommitted (1.9K reputation)SSCommitted (1.9K reputation)SSCommitted (1.9K reputation)SSCommitted (1.9K reputation)SSCommitted (1.9K reputation)SSCommitted (1.9K reputation)

Group: General Forum Members
Points: 1863 Visits: 1815
Wow, this is so ridiculous. The referenced BOL page clearly states:

No column reference pulls data from multiple rows

The answer, however includes the opposite and still claims it as a correct option. As a matter of fact even the wording of all listed options matches the BOL word by word except it does not include the word NO for the multiple rows option.

Oleg
Kingston Dhasian
Kingston Dhasian
SSCarpal Tunnel
SSCarpal Tunnel (4.2K reputation)SSCarpal Tunnel (4.2K reputation)SSCarpal Tunnel (4.2K reputation)SSCarpal Tunnel (4.2K reputation)SSCarpal Tunnel (4.2K reputation)SSCarpal Tunnel (4.2K reputation)SSCarpal Tunnel (4.2K reputation)SSCarpal Tunnel (4.2K reputation)

Group: General Forum Members
Points: 4187 Visits: 5244
UMG Developer (9/29/2010)
I think you need to check the answer key for this question. It lists "Column references can pull data from multiple rows." as one of the options you have to pick, but then in your explanation you say "No column reference pulls data from multiple rows."

And the BOL article you link to says 'No column reference pulls data from multiple rows.", so it seems that "Column references can pull data from multiple rows." is not a correct choice. Either that or you meant for the can to be can't.


I agree. The answer key for the question is wrong. The explanation is correct as per BOL. I think the editors will rectify this soon.


Kingston Dhasian

How to post data/code on a forum to get the best help - Jeff Moden
http://www.sqlservercentral.com/articles/Best+Practices/61537/
honza.mf
honza.mf
SSCrazy
SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)

Group: General Forum Members
Points: 2131 Visits: 1323
Just another 0=1



See, understand, learn, try, use efficient
© Dr.Plch
Carlo Romagnano
Carlo Romagnano
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: 5828 Visits: 3340
Here the script that states "No column reference pulls data from multiple rows"
create function aaaa() returns int
as
begin
return (select SUM(a) from aza )
end
GO
create table aza(a int,b as dbo.aaaa())
create index idx_aza on aza(b) -- raise error: function is NON-DETERMINISTIC

I run on tuttopodismo
Hardy21
Hardy21
SSCommitted
SSCommitted (1.9K reputation)SSCommitted (1.9K reputation)SSCommitted (1.9K reputation)SSCommitted (1.9K reputation)SSCommitted (1.9K reputation)SSCommitted (1.9K reputation)SSCommitted (1.9K reputation)SSCommitted (1.9K reputation)

Group: General Forum Members
Points: 1858 Visits: 1399
Though I am right, I lose point Sad

Thanks
Christian Buettner-167247
Christian Buettner-167247
SSCarpal Tunnel
SSCarpal Tunnel (4.1K reputation)SSCarpal Tunnel (4.1K reputation)SSCarpal Tunnel (4.1K reputation)SSCarpal Tunnel (4.1K reputation)SSCarpal Tunnel (4.1K reputation)SSCarpal Tunnel (4.1K reputation)SSCarpal Tunnel (4.1K reputation)SSCarpal Tunnel (4.1K reputation)

Group: General Forum Members
Points: 4083 Visits: 3889
The first answer (All functions that are referenced by the expression are deterministic and precise.) is incorrect as well. As long as the column is persisted, imprecise functions can be used.

Best Regards,

Chris Büttner
michael.kaufmann
michael.kaufmann
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: 1405 Visits: 1082
UMG Developer (9/29/2010)
I think you need to check the answer key for this question. It lists "Column references can pull data from multiple rows." as one of the options you have to pick, but then in your explanation you say "No column reference pulls data from multiple rows."

And the BOL article you link to says 'No column reference pulls data from multiple rows.", so it seems that "Column references can pull data from multiple rows." is not a correct choice. Either that or you meant for the can to be can't.


Fully agree with UMG Developer.

And I'd also agree with Chris Büttner--but in order to gain a point, just stick with the wording in BOL and disregard anything else, as computed columns need to be persisted in order to be used in an index (and the question was only about 'computed columns' but not about 'persisted computed columns'). Cool

Regards,
Michael
paul.knibbs
paul.knibbs
SSCrazy
SSCrazy (3K reputation)SSCrazy (3K reputation)SSCrazy (3K reputation)SSCrazy (3K reputation)SSCrazy (3K reputation)SSCrazy (3K reputation)SSCrazy (3K reputation)SSCrazy (3K reputation)

Group: General Forum Members
Points: 2994 Visits: 6235
I carefully left that third option unchecked because I thought it was the author attempting a bit of a trick by having just that one worded differently from BOL, too!
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