Table has two columns
CODE varchar(10)
GUID uniqueidentifier,Rowguid (must be there for replication purposes)
When we update a row the CODE column is checked (CODE is unique)
What is better:
- to put primary key on GUID, clustered index and unique index on CODE
- to put primary key on CODE (with clustered index)
Thanx in advance.
½½½½
Martin Bajc> What is better:
That depends. What do you consider "better"?
--
http://www.aspfaq.com/
(Reverse address to reply.)|||"Mike Epprecht (SQL MVP)" <mike@.epprecht.net> wrote in message
news:2FEF2DBA-3766-4FCC-86BA-034E90781AE5@.microsoft.com...
> CODE column, even better, make the CODE column CHAR(10). Fixed with
columns
> are better for indexes.
In what way?|||...better cosidering type of replication, number of rows in table... and
also developer's effort
(visio and EM puts automaticly clustered index on PK, so second choice seems
better to me uless I've missed something)
****
Martin Bajc
"Aaron [SQL Server MVP]" <ten.xoc@.dnartreb.noraa> wrote in message
news:eKcdWdKoEHA.132@.TK2MSFTNGP14.phx.gbl...
> > What is better:
> That depends. What do you consider "better"?
> --
> http://www.aspfaq.com/
> (Reverse address to reply.)
>|||Hi
CODE column, even better, make the CODE column CHAR(10). Fixed with columns
are better for indexes.
A GUID is not bad for an index, but not optimal.
"Martin Bajc" wrote:
> Table has two columns
> CODE varchar(10)
> GUID uniqueidentifier,Rowguid (must be there for replication purposes)
> When we update a row the CODE column is checked (CODE is unique)
>
> What is better:
> - to put primary key on GUID, clustered index and unique index on CODE
> - to put primary key on CODE (with clustered index)
> Thanx in advance.
> ½½½½
> Martin Bajc
>
>
>
>
>
No comments:
Post a Comment