﻿<?xml version='1.0' encoding='UTF-8'?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>SQLServerCentral / Article Discussions / Article Discussions by Author / Discuss content posted by Manie Verster  / Creating indexes on computed columns / Latest Posts</title><generator>InstantForum.NET v2.9.0</generator><description>SQLServerCentral</description><link>http://www.sqlservercentral.com/Forums/</link><webMaster>notifications@sqlservercentral.com</webMaster><lastBuildDate>Thu, 23 May 2013 15:26:14 GMT</lastBuildDate><ttl>20</ttl><item><title>RE: Creating indexes on computed columns</title><link>http://www.sqlservercentral.com/Forums/Topic995722-1380-1.aspx</link><description>There is error. Correcty answer is 1 and 2. But 4 "Has no system data access or user data access."  is correct when computed column marks as persisted and based on function, that  will not have access to user/system tables.Does question "Creating indexes on computed columns" contain any  about persisted ? - No.... I don't won 1 point.</description><pubDate>Thu, 05 Jan 2012 00:59:59 GMT</pubDate><dc:creator>Konstantin Reu</dc:creator></item><item><title>RE: Creating indexes on computed columns</title><link>http://www.sqlservercentral.com/Forums/Topic995722-1380-1.aspx</link><description>Two interesting things here: The first is that the BoL page referenced in the explanation has incorrect information on it: it quite clearly says [quote]A computed_column_expression is deterministic when one or more of the following is true:[/quote] where actually all need to true, not just one.The second is that the corrected answer may still be wrong: as someone pointed out in an earlier comment, the BoL page says (twice) that a computed column which is imprecise can be used in an index provided it is persisted.  So perhaps item 1 should not be in the list of answers to be checked.</description><pubDate>Fri, 01 Oct 2010 14:05:47 GMT</pubDate><dc:creator>L' Eomot Inversé</dc:creator></item><item><title>RE: Creating indexes on computed columns</title><link>http://www.sqlservercentral.com/Forums/Topic995722-1380-1.aspx</link><description>[quote][b]Steve Jones - Editor (9/30/2010)[/b][hr]The answer choices have been corrected and points awarded back.[/quote]Thanks for fixing that - for those of us answering late.</description><pubDate>Thu, 30 Sep 2010 18:40:45 GMT</pubDate><dc:creator>SQLRNNR</dc:creator></item><item><title>RE: Creating indexes on computed columns</title><link>http://www.sqlservercentral.com/Forums/Topic995722-1380-1.aspx</link><description>Just wonder about user data meaning. If I have user defined table it means that it keeps user defined data.Here the very simple example of filtered index on computed columnCREATE TABLE [dbo].[t2](	[c2] [int] NULL,	[comp_col]  AS ([c2]*(2)) PERSISTED) ON [PRIMARY]GOcreate index ix_comp_col on t2 (  comp_col )where c2 &amp;gt; 4GOSo?</description><pubDate>Thu, 30 Sep 2010 12:17:17 GMT</pubDate><dc:creator>gchornenkyy</dc:creator></item><item><title>RE: Creating indexes on computed columns</title><link>http://www.sqlservercentral.com/Forums/Topic995722-1380-1.aspx</link><description>The answer choices have been corrected and points awarded back.</description><pubDate>Thu, 30 Sep 2010 09:22:38 GMT</pubDate><dc:creator>Steve Jones - SSC Editor</dc:creator></item><item><title>RE: Creating indexes on computed columns</title><link>http://www.sqlservercentral.com/Forums/Topic995722-1380-1.aspx</link><description>No column reference pulls data from multiple rows. For example, aggregate functions such as SUM or AVG depend on data from multiple rows and would make a computed_column_expression nondeterministic.</description><pubDate>Thu, 30 Sep 2010 08:45:07 GMT</pubDate><dc:creator>hkamal.infoedge</dc:creator></item><item><title>RE: Creating indexes on computed columns</title><link>http://www.sqlservercentral.com/Forums/Topic995722-1380-1.aspx</link><description>Hi,As others did, I have selected choices 1,2 and 4 and left 3 unchecked. If this is wrong then MSDN itself wrong. Please refer the linkhttp://msdn.microsoft.com/en-us/library/ms189292.aspxI am not responding to gain the point, but to get exactly which is correct answer.Regards,</description><pubDate>Thu, 30 Sep 2010 07:55:53 GMT</pubDate><dc:creator>gajapathy</dc:creator></item><item><title>RE: Creating indexes on computed columns</title><link>http://www.sqlservercentral.com/Forums/Topic995722-1380-1.aspx</link><description>Hi Steve,[quote][b]Steve Eckhart (9/30/2010)[/b][hr]Actually, if you read carefully, an index on a computed column CAN include multiple rows and columns from other tables. [/quote]Can you give an example of multiple rows? I doubt it.And for the columns from other tables -&amp;gt; That is per definition non-deterministic.[url]http://msdn.microsoft.com/en-us/library/aa214775(SQL.80).aspx[/url][quote]As long as [i]one[/i] of the following four conditions are true, then you can use the computed column in an index.[/quote]Now that does not say "exactly" one, it means one or more. It does not tell you which combinations would be deterministic and precise.</description><pubDate>Thu, 30 Sep 2010 07:50:12 GMT</pubDate><dc:creator>Christian Buettner-167247</dc:creator></item><item><title>RE: Creating indexes on computed columns</title><link>http://www.sqlservercentral.com/Forums/Topic995722-1380-1.aspx</link><description>Please check the answers before posting a question.  People use the QofD as a way to learn or to refresh the memory on a given topic.  Bad and incorrect questions just waste time.</description><pubDate>Thu, 30 Sep 2010 07:33:13 GMT</pubDate><dc:creator>daveb87</dc:creator></item><item><title>RE: Creating indexes on computed columns</title><link>http://www.sqlservercentral.com/Forums/Topic995722-1380-1.aspx</link><description>I don't mind getting a question wrong, but only when the answer i give is the wrong one.  The third choice is clearly incorrect as true when read in BOL.</description><pubDate>Thu, 30 Sep 2010 07:31:09 GMT</pubDate><dc:creator>gary.mazzone</dc:creator></item><item><title>RE: Creating indexes on computed columns</title><link>http://www.sqlservercentral.com/Forums/Topic995722-1380-1.aspx</link><description>Actually, if you read carefully, an index on a computed column CAN include multiple rows and columns from other tables. As long as [i]one[/i] of the following four conditions are true, then you can use the computed column in an index. Therefore, only the first answer is necessary and the other three are incorrect answers.[quote]The computed_column_expression must be deterministic. A computed_column_expression is deterministic when one or more of the following is true: All functions that are referenced by the expression are deterministic and precise. These functions include both user-defined and built-in functions. For more information, see Deterministic and Nondeterministic Functions. Functions might be imprecise if the computed column is PERSISTED. For more information, see Creating Indexes on Persisted Computed Columns later in this topic.All columns that are referenced in the expression come from the table that contains the computed column.No column reference pulls data from multiple rows. For example, aggregate functions such as SUM or AVG depend on data from multiple rows and would make a computed_column_expression nondeterministic.Has no system data access or user data access.[/quote]</description><pubDate>Thu, 30 Sep 2010 07:13:51 GMT</pubDate><dc:creator>Steve Eckhart</dc:creator></item><item><title>RE: Creating indexes on computed columns</title><link>http://www.sqlservercentral.com/Forums/Topic995722-1380-1.aspx</link><description>Very disappointing.  This is a fairly basic question.  A little proofreading could have prevented this from becoming a bad question.</description><pubDate>Thu, 30 Sep 2010 07:12:21 GMT</pubDate><dc:creator>JestersGrind</dc:creator></item><item><title>RE: Creating indexes on computed columns</title><link>http://www.sqlservercentral.com/Forums/Topic995722-1380-1.aspx</link><description>Manie: Your answers are wrong. You state that you [b]can[/b] pull data from multiple rows, yet BOL which you state as your reference says [quote]No column reference pulls data from multiple rows. For example, aggregate functions such as SUM or AVG depend on data from multiple rows and would make a computed_column_expression nondeterministic.[/quote]Can't have it both ways.</description><pubDate>Thu, 30 Sep 2010 06:45:58 GMT</pubDate><dc:creator>sjimmo</dc:creator></item><item><title>RE: Creating indexes on computed columns</title><link>http://www.sqlservercentral.com/Forums/Topic995722-1380-1.aspx</link><description>"Me too" on the incorrect options stuff.But in any case, 1 point is a bit mean for a 4-checkbox multiselect question</description><pubDate>Thu, 30 Sep 2010 06:29:20 GMT</pubDate><dc:creator>Toreador</dc:creator></item><item><title>RE: Creating indexes on computed columns</title><link>http://www.sqlservercentral.com/Forums/Topic995722-1380-1.aspx</link><description>Yes,http://msdn.microsoft.com/en-us/library/ms189292.aspx#BKMK_persisted states that:"You can create an index on a computed column that is defined with a deterministic, but imprecise, expression if the column is marked PERSISTED in the CREATE TABLE or ALTER TABLE statement."</description><pubDate>Thu, 30 Sep 2010 05:58:41 GMT</pubDate><dc:creator>rtelgenhoff</dc:creator></item><item><title>RE: Creating indexes on computed columns</title><link>http://www.sqlservercentral.com/Forums/Topic995722-1380-1.aspx</link><description>The explanation contradicts answer number 3 being true.</description><pubDate>Thu, 30 Sep 2010 05:37:04 GMT</pubDate><dc:creator>William Vach</dc:creator></item><item><title>RE: Creating indexes on computed columns</title><link>http://www.sqlservercentral.com/Forums/Topic995722-1380-1.aspx</link><description>please see [url]http://msdn.microsoft.com/en-us/library/ms189292.aspx[/url], the third answer is incorrect, I am sure Steve will rectify the situation.this actually follows on from the question two days ago, which is why I answered it.</description><pubDate>Thu, 30 Sep 2010 03:35:28 GMT</pubDate><dc:creator>george sibbald</dc:creator></item><item><title>RE: Creating indexes on computed columns</title><link>http://www.sqlservercentral.com/Forums/Topic995722-1380-1.aspx</link><description>Yet another error. I won't tolerate any mealy-mouthed excuses, such as those which we have experienced in the past. Go to the very bottom of the class, and stay there with your dunces cap on, until I permit you to move.[And give me my point]Kenneth Spencer.</description><pubDate>Thu, 30 Sep 2010 03:25:23 GMT</pubDate><dc:creator>kaspencer</dc:creator></item><item><title>RE: Creating indexes on computed columns</title><link>http://www.sqlservercentral.com/Forums/Topic995722-1380-1.aspx</link><description>Like the many others I have select the 3 options and not selected Column references can pull data from multiple rows. From what I can tell I was right like the others so give me my 1 point:angry:</description><pubDate>Thu, 30 Sep 2010 02:55:57 GMT</pubDate><dc:creator>Imran Ashraf-452633</dc:creator></item><item><title>RE: Creating indexes on computed columns</title><link>http://www.sqlservercentral.com/Forums/Topic995722-1380-1.aspx</link><description>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!</description><pubDate>Thu, 30 Sep 2010 02:46:22 GMT</pubDate><dc:creator>paul.knibbs</dc:creator></item><item><title>RE: Creating indexes on computed columns</title><link>http://www.sqlservercentral.com/Forums/Topic995722-1380-1.aspx</link><description>[quote][b]UMG Developer (9/29/2010)[/b][hr]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 [b]can[/b] to be [b]can't[/b].[/quote]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 [b]persisted[/b] 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</description><pubDate>Thu, 30 Sep 2010 02:22:56 GMT</pubDate><dc:creator>michael.kaufmann</dc:creator></item><item><title>RE: Creating indexes on computed columns</title><link>http://www.sqlservercentral.com/Forums/Topic995722-1380-1.aspx</link><description>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.</description><pubDate>Thu, 30 Sep 2010 01:43:57 GMT</pubDate><dc:creator>Christian Buettner-167247</dc:creator></item><item><title>RE: Creating indexes on computed columns</title><link>http://www.sqlservercentral.com/Forums/Topic995722-1380-1.aspx</link><description>Though I am right, I lose point :(</description><pubDate>Thu, 30 Sep 2010 01:23:16 GMT</pubDate><dc:creator>Hardy21</dc:creator></item><item><title>RE: Creating indexes on computed columns</title><link>http://www.sqlservercentral.com/Forums/Topic995722-1380-1.aspx</link><description>Here the script that states "No column reference pulls data from multiple rows"create function aaaa() returns intasbegin    return (select SUM(a) from aza )endGOcreate table aza(a int,b as dbo.aaaa())create index idx_aza on aza(b) -- raise error: function is NON-DETERMINISTIC</description><pubDate>Thu, 30 Sep 2010 01:09:30 GMT</pubDate><dc:creator>Carlo Romagnano</dc:creator></item><item><title>RE: Creating indexes on computed columns</title><link>http://www.sqlservercentral.com/Forums/Topic995722-1380-1.aspx</link><description>Just another 0=1</description><pubDate>Thu, 30 Sep 2010 01:04:10 GMT</pubDate><dc:creator>honza.mf</dc:creator></item><item><title>RE: Creating indexes on computed columns</title><link>http://www.sqlservercentral.com/Forums/Topic995722-1380-1.aspx</link><description>[quote][b]UMG Developer (9/29/2010)[/b][hr]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 [b]can[/b] to be [b]can't[/b].[/quote]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.</description><pubDate>Wed, 29 Sep 2010 23:00:29 GMT</pubDate><dc:creator>Kingston Dhasian</dc:creator></item><item><title>RE: Creating indexes on computed columns</title><link>http://www.sqlservercentral.com/Forums/Topic995722-1380-1.aspx</link><description>Wow, this is so ridiculous. The referenced BOL page clearly states:[quote]No column reference pulls data from multiple rows[/quote]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 [b]NO[/b] for the multiple rows option.Oleg</description><pubDate>Wed, 29 Sep 2010 22:01:34 GMT</pubDate><dc:creator>Oleg Netchaev</dc:creator></item><item><title>RE: Creating indexes on computed columns</title><link>http://www.sqlservercentral.com/Forums/Topic995722-1380-1.aspx</link><description>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 [b]can[/b] to be [b]can't[/b].</description><pubDate>Wed, 29 Sep 2010 21:52:19 GMT</pubDate><dc:creator>UMG Developer</dc:creator></item><item><title>Creating indexes on computed columns</title><link>http://www.sqlservercentral.com/Forums/Topic995722-1380-1.aspx</link><description>Comments posted to this topic are about the item [B]&lt;A HREF="/questions/computed+column/71061/"&gt;Creating indexes on computed columns&lt;/A&gt;[/B]</description><pubDate>Wed, 29 Sep 2010 21:49:10 GMT</pubDate><dc:creator>Manie Verster</dc:creator></item></channel></rss>