The altered column cannot be:
* A column with a text, image, ntext, or timestamp data type.
* The ROWGUIDCOL for the table.
* A computed column or be used in a computed column.
* A replicated column.
* Used in an index, unless the column is a varchar or varbinary data type, the data type is not changed, and the new size is equal to or larger than the old size.
* Used in statistics generated by the CREATE STATISTICS statement. First remove the statistics using the DROP STATISTICS statement. Statistics automatically generated by the query optimizer are automatically dropped by ALTER COLUMN.
* Used in a PRIMARY KEY or [FOREIGN KEY] REFERENCES constraint.
* Used in a CHECK or UNIQUE constraint, except that altering the length of a variable-length column used in a CHECK or UNIQUE constraint is allowed.
* Associated with a default, except that changing the length, precision, or scale of a column is allowed if the data type is not changed.
My guess is that you are trying to change it's type and that you have a constraint on the column which is disallowing your alter table.
You can drop and re-add the column with this code (it will re-create your identities):
BEGIN TRANSACTION
SET QUOTED_IDENTIFIER ON
GO
SET TRANSACTION ISOLATION LEVEL SERIALIZABLE
GO
COMMIT
BEGIN TRANSACTION
CREATE TABLE dbo.Tmp_TABLE1
(
testid int IDENTITY(1,1) NOT NULL,
test2 char(10) NULL
) ON [PRIMARY]
GO
IF EXISTS(SELECT * FROM dbo.TABLE1)
EXEC('INSERT INTO dbo.Tmp_TABLE1(test2)
SELECT test2 FROM dbo.TABLE1 TABLOCKX')
GO
DROP TABLE dbo.TABLE1
GO
EXECUTE sp_rename 'dbo.Tmp_TABLE1', 'TABLE1'
GO
COMMIT Tom Davis
tdavis@sark.com