Re: Change Unique ID to non unique ID in replicated table

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: Vivek Sharma (joebloggs_at_news.com)
Date: 09/01/04


Date: Thu, 2 Sep 2004 09:57:33 +1200

Thanks a lot Hilary. It was a great help.

Vivek

"Hilary Cotter" <hilary.cotter@gmail.com> wrote in message
news:elqZKECkEHA.384@TK2MSFTNGP10.phx.gbl...
> 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
>
>
> "Vivek Sharma" <joebloggs@news.com> wrote in message
> news:OV7xLN9jEHA.2412@TK2MSFTNGP15.phx.gbl...
> > 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
> >
> >
> > "Hilary Cotter" <hilary.cotter@gmail.com> wrote in message
> > news:%23Dv3VS1jEHA.1520@TK2MSFTNGP10.phx.gbl...
> > > 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
> > >
> > >
> > > "Vivek" <vivek@nospam.com> wrote in message
> > > news:uMeeotwjEHA.2908@TK2MSFTNGP10.phx.gbl...
> > > > 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?
> > > >
> > > >
> > >
> > >
> >
> >
>
>



Relevant Pages

  • Re: DataTable.PrimaryKey Can I change the values of a primary key?
    ... SQL Database using Ado.Net, and having .Net and SQL define the primary ... When I alter or change the values and I update or AcceptChanges my ... If I load a customer record into my DataTable with CustomerID as the ... PrimaryKey and from the load this value is 1234; ...
    (microsoft.public.dotnet.framework)
  • Re: Is AutoIncrement recommended or not?
    ... > Primarykey field ... I am not aware of issues related to autonumbering, ... What happens with related records in other tables has nothing to do with ... My opinion is that Primary Key shouldn't have any other meaning rather than ...
    (microsoft.public.vb.database.ado)
  • Re: Is AutoIncrement recommended or not?
    ... > to be PrimaryKey. ... And Primary Key is just a special case of Unique Index. ... I thought for a column to become a Foreign Key in another table it had ...
    (microsoft.public.vb.database.ado)
  • Re: Unique Index
    ... Job Dwg ... I want add a autonumber primary key. ... ' PrimaryKey - the name of the primary key index ...
    (comp.databases.ms-access)
  • Re: Exposing a private instance field in SOAP
    ... >> The PrimaryKey class internally stores the data as either a int or a Guid ... >> If we simply used int to represent a primary key, ... >> through SOAP. ...
    (microsoft.public.dotnet.framework.webservices)