views:

777

answers:

1

What command would I execute to safely change (i.e. from int to bigint) a replicated column's data type in SQL Server 2005?

The column is not a key. There is a non-clustered index on the column.

+1  A: 
ALTER TABLE MyTable 
    ALTER COLUMN myIntCol bigint

From BOL:

By default, the following schema changes made at a Publisher running SQL Server are replicated to all SQL Server Subscribers:

  • ALTER TABLE
  • ALTER VIEW
  • ALTER PROCEDURE
  • ALTER FUNCTION
  • ALTER TRIGGER
Mitch Wheat
Sorry I forgot to add that there is an index on the column, and the command above is producing an error when executed. Would I have to remove the index?
triniMahn
ah!, yes you would.
Mitch Wheat
ok, great! Thanks!
triniMahn