all groups > sql server replication > august 2004 >
You're in the

sql server replication

group:

Change Unique ID to non unique ID in replicated table


Re: Change Unique ID to non unique ID in replicated table Hilary Cotter
8/31/2004 8:15:34 AM
sql server replication: Exactly what do you mean by non-unique. There are three kinds of indexes,
clustered, non clustered or unique.

Unique means an index or actually a constraint that uses an index, which
ensures unique values and allows a null. A non-clustered index is an index
that is maintained on a seperate database page containing pointers which
point back to where in the table a particular value occurs. A clustered
index orders the data in the table according to a criteria.

To change an index you do this

sp_help tablename and obtain the index name

then drop the index

drop index authors.aunmind

then recreate it (if you want to convert the index to a clustered or
non-clustered index).

I assume you are talking about the table on the subscriber.

If you want to replicate a primary key which occurs on a published table on
the publisher to a primary key on the subscriber right click on yoru
publication, select properties, click the articles tab, and click the three
ellipses next to your article you wish to modify the index on. Then in the
snapshot tab, check include DRI. By default primary keys are replicated as
unique indexes on the subscriber.

HTH

--
Hilary Cotter
Looking for a book on SQL Server replication?
http://www.nwsu.com/0974973602.html


[quoted text, click to view]

Change Unique ID to non unique ID in replicated table Vivek
8/31/2004 3:35:25 PM
Hi,

I have a replicated to table. It has the ID column as unique and I want it
to convert it into non unique. How can I do it?

Re: Change Unique ID to non unique ID in replicated table Hilary Cotter
9/1/2004 8:39:06 AM
You will have to alter the table to drop the constraint

create table primarykey
(pk int not null identity(1,1) primary key)
GO
sp_help primarykey
GO
--scroll down until you see the name of the primary key - in our case its
called PK__primarykey__52AE4273
alter table primarykey
drop constraint PK__primarykey__52AE4273
GO

--
Hilary Cotter
Looking for a book on SQL Server replication?
http://www.nwsu.com/0974973602.html


[quoted text, click to view]

Re: Change Unique ID to non unique ID in replicated table Vivek Sharma
9/1/2004 10:18:19 AM
Hi Hillary,

Thanks for your reply. I think I should have framed my query differently.
I have a table on publisher with a primary key. What we intend to do is get
rid of the primary key so that we can insert any number and the following
records. Now, how do I can I change the column to be not primary key.

Thanks

Vivek


[quoted text, click to view]

Re: Change Unique ID to non unique ID in replicated table Vivek Sharma
9/2/2004 9:57:33 AM
Thanks a lot Hilary. It was a great help.

Vivek

[quoted text, click to view]

AddThis Social Bookmark Button