Hello Gurus,
I'm in the middle of my 70-229 certification and have been messing around with defining identity and rowguidcol values in some tables. I'm struggling to understand what the rowguidcol property actually does. Allow me to illustrate my problem:
create table t1 (
c1 uniqueidentifier rowguidcol default newid() not null,
c2 varchar(20)
)
and:
create table t2 (
c1 uniqueidentifier default newid() not null,
c2 varchar(20)
)
Both statements seem to be equivalent as far as I can see in terms of auto-generating GUID values in c1. The only difference I can spot is that the first statement allows you to query c1 using:
select rowguidcol from t1
whereas the 2nd statement doesnt allow this. Is this the only difference or am I missing a trick somewhere?
Thanks guys,
Neil
I'm in the middle of my 70-229 certification and have been messing around with defining identity and rowguidcol values in some tables. I'm struggling to understand what the rowguidcol property actually does. Allow me to illustrate my problem:
create table t1 (
c1 uniqueidentifier rowguidcol default newid() not null,
c2 varchar(20)
)
and:
create table t2 (
c1 uniqueidentifier default newid() not null,
c2 varchar(20)
)
Both statements seem to be equivalent as far as I can see in terms of auto-generating GUID values in c1. The only difference I can spot is that the first statement allows you to query c1 using:
select rowguidcol from t1
whereas the 2nd statement doesnt allow this. Is this the only difference or am I missing a trick somewhere?
Thanks guys,
Neil