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

sql server replication

group:

Alter column From Not Null to allow Nulls


Alter column From Not Null to allow Nulls nate axtell
11/12/2004 2:52:25 PM
sql server replication:
Using Push Merge Replication I am looking for a one step process to apply a
Column change to make the column allow Nulls where the column currently does
not allow nulls (NOT NULL). The table is currently published. So far I can
only think of a three step process which requires two intermediate
synchronizations. The change needs to be made now on the server and be
ready to get applied to a subscriber whenever they reconnect. Here is the
three step process I would like to simplify somehow:

1. Add a Temp Column
a) with the @schema_change_script parameter being passed a script that
copies the data from the original column to the temp column.
b) Drop any Constraints on the Original Column
c) Replicate these changes through
2. Drop the original column
a) Add a new column with the same name as the original column but
allowing NULLs
b) pass in a schema change script for copying the original data from
the Temp column to the new column.
c) Replicate these changes
3. Drop Temp column
a) Replicate

Thanks for any assistance,
Nate

Alter column From Not Null to allow Nulls Paul Ibison
11/13/2004 7:53:18 AM
Nate,
this looks correct, but many people avoid the hassle by
simply resynchronizing.
Rgds,
Paul Ibison SQL Server MVP, www.replicationanswers.com

(recommended sql server 2000 replication book:
http://www.nwsu.com/0974973602p.html)
AddThis Social Bookmark Button