« Microsoft SQL 2005 find tables missing primary keys
» SET IDENTITY INSERT Microsoft SQL Server

SQL, Microsoft

Alter a table that is published under SQL 2005 replication

06.17.08 | Comment?

Having recently implemented Microsoft SQL 2005 replication for a client, we had a few issues with developers trying to alter schema on the database if the table is under replication. The issue is caused because the Microsoft Visual GUI tools for SQL 2005, tries to drop and recreate the table, which is obviously not acceptable if a table is replicated. However there is a way to achieve this and I found this neat code snippet from Paul Ibison - Altering Schema in Microsoft SQL 2005 Server Replication. The statement is as follows:

ALTER TABLE myTable ALTER COLUMN columnName VARCHAR(100) NULL

Not a huge chunk of code, but definitely helpful! :-)

have your say

Add your comment below, or trackback from your own site. Subscribe to these comments.

Be nice. Keep it clean. Stay on topic. No spam.

You can use these tags:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>

:

:


« Microsoft SQL 2005 find tables missing primary keys
» SET IDENTITY INSERT Microsoft SQL Server