Monday, March 19, 2012

I cannot alter a table

Hi,
I have installed (attached) a new database. I need to change the length of a
field using this command:
ALTER TABLE CDRData ALTER COLUMN Locality varchar(10) NULL
But I got this error:
Server: Msg 4929, Level 16, State 1, Line 1
Cannot alter the table 'CDRData' because it is being published for
replication.
In Enterprise Manager, when I expand Replication->publications I don't see
any item(it is empty).
Could you please let me know how can I remove this publishing thing from my
table to be able to alter it?
Thank you,
Rosie
Rosie,
There is a stored procedure to do this called sp_MSunmarkreplinfo which
takes a tablename as a parameter. Alternatively, setting replinfo to 0 in
sysobjects for the particular table should do it. Finally, running
sp_removedbreplication can be used to remove all traces of replication in
the subscriber database, but obviously must only be done if this database is
not also configured as a publisher.
Rgds,
Paul Ibison SQL Server MVP, www.replicationanswers.com
(recommended sql server 2000 replication book:
http://www.nwsu.com/0974973602p.html)
|||Thank you Paul.
R.
"Paul Ibison" wrote:

> Rosie,
> There is a stored procedure to do this called sp_MSunmarkreplinfo which
> takes a tablename as a parameter. Alternatively, setting replinfo to 0 in
> sysobjects for the particular table should do it. Finally, running
> sp_removedbreplication can be used to remove all traces of replication in
> the subscriber database, but obviously must only be done if this database is
> not also configured as a publisher.
> Rgds,
> Paul Ibison SQL Server MVP, www.replicationanswers.com
> (recommended sql server 2000 replication book:
> http://www.nwsu.com/0974973602p.html)
>
>

No comments:

Post a Comment