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


ROWGUIDCOL


ROWGUIDCOL

Author
Message
Koen Verbeeck
Koen Verbeeck
SSCoach
SSCoach (16K reputation)SSCoach (16K reputation)SSCoach (16K reputation)SSCoach (16K reputation)SSCoach (16K reputation)SSCoach (16K reputation)SSCoach (16K reputation)SSCoach (16K reputation)

Group: General Forum Members
Points: 16441 Visits: 13202
Tom.Thomson (3/8/2011)
Interesting question.

There is however a problem with use of imprecise English - this is of course sheer nit-picking, and I'm not complaining because I guessed that the chances were better than even that imprecise English was being used so that I got it "right" by deliberately selecting an answer I knew to be wrong.

The right answer of course is "each of them can (but only one at a time)" so of the options provided 3 is closest to correct. 1 (the "right" answer) would only be really correct if the question was "how many of them can be rowguidcol columns at the same time".


You are right, it is sheer nit-picking :-)
However, it does not make your point less valid...



How to post forum questions.
Need an answer? No, you need a question.
What’s the deal with Excel & SSIS?

Member of LinkedIn. My blog at SQLKover.

MCSA SQL Server 2012 - MCSE Business Intelligence
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: 1410 Visits: 1046
Tom.Thomson (3/8/2011)

The right answer of course is "each of them can (but only one at a time)" so of the options provided 3 is closest to correct. 1 (the "right" answer) would only be really correct if the question was "how many of them can be rowguidcol columns at the same time".


I have to agree to disagree with this statement.
"enabled" is the key word in this question and makes perfect english as the last word in the question. This makes it the main describer for the question.

You can "enable" ROWGUIDCOL on any UID column in a table, but it can only be "enabled" on one row.
When something is done and the switch is on it is enabled.

The concept I learned from the question is that enabling ROWGUID on any column automaticly disables it on all other columns when using Table Designer.

When being done from a script the DDL you have to use to make another column the ROWGUIDCOL really brings home why the question makes perfect sense.

Create a table called Table_1 give it three UID columns and set the first or second one to ROWGUID.
CREATE TABLE [dbo].[Table_1](
   [uid01] [uniqueidentifier] ROWGUIDCOL NULL,
   [uid02] [uniqueidentifier] NULL,
   [uid03] [uniqueidentifier] NULL
) ON [PRIMARY]
ALTER TABLE [dbo].[Table_1] ADD CONSTRAINT [DF_Table_1_uid01] DEFAULT (newid()) FOR [uid01]
ALTER TABLE [dbo].[Table_1] ADD CONSTRAINT [DF_Table_1_uid02] DEFAULT (newid()) FOR [uid02]
ALTER TABLE [dbo].[Table_1] ADD CONSTRAINT [DF_Table_1_uid03] DEFAULT (newid()) FOR [uid03]
GO

Now try to Alter the table and set any other column to ROWGUID.
ALTER TABLE dbo.Table_1 ALTER COLUMN uid02
   ADD ROWGUIDCOL
GO

It can't be done because ROWGUIDCOL is already enabled on another COLUMN and it can only be enabled on ONE column. This looks really wierd when using the querry designer becuase it will let you select YES to the option on any column, but it is only enabled on the last one you pick.
Try it out.

BEGIN TRANSACTION
ALTER TABLE dbo.Table_1 ALTER COLUMN uid03
   DROP ROWGUIDCOL
GO
ALTER TABLE dbo.Table_1 ALTER COLUMN uid02
   ADD ROWGUIDCOL
GO
COMMIT

So lets read the qustion again:
How many UID columns in a table can have ROWGUIDCOL enabled?

You can enable it on any UID column in a table, but it can only be enabled on one column.

One last thing to point out about ROWGUIDCOL property is that differant from an Identity Column, the Object explorer gives you no clues about which column has ROWGUIDCOL enabled.
Daniel Bowlin
Daniel Bowlin
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: 2952 Visits: 2629
I guess my question is, once you have a GUID, what is the point of the other unique columns?
Surii
Surii
Say Hey Kid
Say Hey Kid (697 reputation)Say Hey Kid (697 reputation)Say Hey Kid (697 reputation)Say Hey Kid (697 reputation)Say Hey Kid (697 reputation)Say Hey Kid (697 reputation)Say Hey Kid (697 reputation)Say Hey Kid (697 reputation)

Group: General Forum Members
Points: 697 Visits: 489
nice and easy one..
M&M
M&M
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: 2595 Visits: 3898
Daniel Bowlin (3/8/2011)
I guess my question is, once you have a GUID, what is the point of the other unique columns?


I think there is no point in adding other unique colums. I just happened to read about GUID's and thought of this question.

M&M
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: 1466 Visits: 3059
Tom.Thomson (3/8/2011)
Interesting question.

There is however a problem with use of imprecise English - this is of course sheer nit-picking, and I'm not complaining because I guessed that the chances were better than even that imprecise English was being used so that I got it "right" by deliberately selecting an answer I knew to be wrong.

The right answer of course is "each of them can (but only one at a time)" so of the options provided 3 is closest to correct. 1 (the "right" answer) would only be really correct if the question was "how many of them can be rowguidcol columns at the same time".

Tom, you've shown that you'd never have trouble with this riddle: If I have two American coins with a total value of 30 cents and one of them is not a quarter, what are they?
SQLRNNR
SQLRNNR
SSC-Insane
SSC-Insane (21K reputation)SSC-Insane (21K reputation)SSC-Insane (21K reputation)SSC-Insane (21K reputation)SSC-Insane (21K reputation)SSC-Insane (21K reputation)SSC-Insane (21K reputation)SSC-Insane (21K reputation)

Group: General Forum Members
Points: 21073 Visits: 18259
Daniel Bowlin (3/8/2011)
I guess my question is, once you have a GUID, what is the point of the other unique columns?


Sadly, there are numerous products that use it as the PK as well as FKs in child tables. Thus there would be several GUIDs. One example of such a product is Microsoft Dynamics CRM.



Jason AKA CirqueDeSQLeil
I have given a name to my pain...
MCM SQL Server, MVP


SQL RNNR

Posting Performance Based Questions - Gail Shaw

SQLRNNR
SQLRNNR
SSC-Insane
SSC-Insane (21K reputation)SSC-Insane (21K reputation)SSC-Insane (21K reputation)SSC-Insane (21K reputation)SSC-Insane (21K reputation)SSC-Insane (21K reputation)SSC-Insane (21K reputation)SSC-Insane (21K reputation)

Group: General Forum Members
Points: 21073 Visits: 18259
Thanks for the question.



Jason AKA CirqueDeSQLeil
I have given a name to my pain...
MCM SQL Server, MVP


SQL RNNR

Posting Performance Based Questions - Gail Shaw

UMG Developer
UMG Developer
SSCrazy
SSCrazy (2.3K reputation)SSCrazy (2.3K reputation)SSCrazy (2.3K reputation)SSCrazy (2.3K reputation)SSCrazy (2.3K reputation)SSCrazy (2.3K reputation)SSCrazy (2.3K reputation)SSCrazy (2.3K reputation)

Group: General Forum Members
Points: 2280 Visits: 2204
Thanks for the question, I did have to go read in BOL to figure out how to answer it, so I learned something.
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: 10700 Visits: 11991
SanDroid (3/8/2011)
Tom.Thomson (3/8/2011)

The right answer of course is "each of them can (but only one at a time)" so of the options provided 3 is closest to correct. 1 (the "right" answer) would only be really correct if the question was "how many of them can be rowguidcol columns at the same time".


I have to agree to disagree with this statement.
"enabled" is the key word in this question and makes perfect english as the last word in the question. This makes it the main describer for the question.


I don't think the word "enabled" helps at all. The way the question is phrased would allow it to help only if the word "simultaneously" were inserted between "can" and "have" (or after "enabled" if a little sloppiness is permitted).

Tom

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