Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 How to alter column to all the tables

Author  Topic 

Hunglech
Starting Member

16 Posts

Posted - 2005-09-15 : 00:32:32
Hi every one
How can i alter column to all the tables
if i used "ALTER TABLE TableName ALTER COLUMN ColumnName CHAR(10)", some table occur error: "ALTER TABLE ALTER COLUMN ColumnName failed because one or more objects access this column."

Pls Help me, Thanks


madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2005-09-15 : 01:17:59
It is because that column is referenced by other table as foreign key
You need to remove the reference, alter column and then make reference

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

Hunglech
Starting Member

16 Posts

Posted - 2005-09-18 : 21:59:31
Thanks Madhivanan for your reply, can you tell me how to remove and make reference automatically. My Database have about 800 tables that had referenced

Go to Top of Page
   

- Advertisement -