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
 Transact-SQL (2000)
 Altering Tables

Author  Topic 

mistux
Yak Posting Veteran

90 Posts

Posted - 2005-08-27 : 17:20:30
I am trying to increase one of my fields in one of my tables from 30 to 50 characters useing:
 ALTER TABLE T_CustNotes ALTER COLUMN CustId NVARCHAR(50)


but I am getting the error:

the object xxx is dependent on column CustId

Waht's up?

Michael
For all your DNC needs for your CNC machines. www.mis-group.com

robvolk
Most Valuable Yak

15732 Posts

Posted - 2005-08-27 : 19:00:53
If you have constraints or indexes on that column, you cannot alter the column without dropping them first.
Go to Top of Page

mistux
Yak Posting Veteran

90 Posts

Posted - 2005-08-28 : 11:47:43
quote:
Originally posted by robvolk

If you have constraints or indexes on that column, you cannot alter the column without dropping them first.



And how might i do that?

Michael
For all your DNC needs for your CNC machines. www.mis-group.com
Go to Top of Page

robvolk
Most Valuable Yak

15732 Posts

Posted - 2005-08-28 : 12:10:33
ALTER TABLE myTable DROP CONSTRAINT xxx...

Not much different than the syntax for altering or dropping a column, Books Online has the precise syntax if you need it.
Go to Top of Page

mistux
Yak Posting Veteran

90 Posts

Posted - 2005-08-31 : 13:38:40
Thanks robvolk, I'll give it a try.

Michael
For all your DNC needs for your CNC machines. www.mis-group.com
Go to Top of Page
   

- Advertisement -