Groups | Blog | Home
all groups > sql server replication > july 2003 >

sql server replication : sp_repldropcolumn on columns with default values (mergerepl)


Hilary Cotter
7/30/2003 12:44:01 PM
Is this article filtered? If it is you will have to re-
initialize all subscribers.
[quoted text, click to view]
S c o t t K r a m e r
7/30/2003 6:22:22 PM
Hello:

Is there a way to drop repl coulmns with default values, (so that it
propagates to existing subscribers)

Can you safely get rid of the DF_ object without breaking repl?

Note: we do not want to reint subs, rebuild the pub etc...

Thanks,
Scott Kramer

EXEC sp_repladdcolumn
@source_object = 'lahdr'
, @column = 'lahdrenteredtime1'
, @typetext = 'varchar(8) NOT NULL DEFAULT (convert(varchar,getdate(),8))'
, @publication_to_add = 'gwb'


sp_repldropcolumn
@source_object = 'lahdr'
,@column = 'lahdrenteredtime1'


Warning: only Subscribers running SQL Server 2000 can synchronize with
publication 'gwb' because schema replication is performed.
Server: Msg 5074, Level 16, State 1, Line 1
The object 'DF__lahdr__lahdrente__39BF9D86' is dependent on column
'lahdrenteredtime1'.
Server: Msg 4922, Level 16, State 1, Line 1
ALTER TABLE DROP COLUMN lahdrenteredtime1 failed because one or more objects
access this column.

Narayana Vyas Kondreddi
7/30/2003 10:08:26 PM
See if this helps:
http://support.microsoft.com/default.aspx?scid=kb;en-us;816755

--
HTH,
Vyas, MVP (SQL Server)
http://vyaskn.tripod.com/
What hardware is your SQL Server running on?
http://vyaskn.tripod.com/poll.htm




[quoted text, click to view]
Hello:

Is there a way to drop repl coulmns with default values, (so that it
propagates to existing subscribers)

Can you safely get rid of the DF_ object without breaking repl?

Note: we do not want to reint subs, rebuild the pub etc...

Thanks,
Scott Kramer

EXEC sp_repladdcolumn
@source_object = 'lahdr'
, @column = 'lahdrenteredtime1'
, @typetext = 'varchar(8) NOT NULL DEFAULT (convert(varchar,getdate(),8))'
, @publication_to_add = 'gwb'


sp_repldropcolumn
@source_object = 'lahdr'
,@column = 'lahdrenteredtime1'


Warning: only Subscribers running SQL Server 2000 can synchronize with
publication 'gwb' because schema replication is performed.
Server: Msg 5074, Level 16, State 1, Line 1
The object 'DF__lahdr__lahdrente__39BF9D86' is dependent on column
'lahdrenteredtime1'.
Server: Msg 4922, Level 16, State 1, Line 1
ALTER TABLE DROP COLUMN lahdrenteredtime1 failed because one or more objects
access this column.



S c o t t K r a m e r
7/31/2003 2:17:11 PM
Hi Thanks!

I actually did find that after I posted, but it seems very dangerous & I
could not get that method to work in our test lab... I have another post
refering to sp_addscriptexec---

there just needs to be a sp_removescriptexec!!! in case of trouble!!!

Thanks,
Scott
[quoted text, click to view]

AddThis Social Bookmark Button