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.
| Author |
Topic |
|
SamC
White Water Yakist
3467 Posts |
Posted - 2002-07-28 : 18:02:24
|
| ALTER TABLE Users DROP COLUMN EmployeeTypeReturnsALTER TABLE DROP COLUMN EmployeeType failed because one or more objects access this column.So, there's a dependency created by the DEFAULT '' On this field.I've checked BOL, and other than explicitly DROPing the Dependency, is there a more direct way to drop this column?SamC |
|
|
robvolk
Most Valuable Yak
15732 Posts |
Posted - 2002-07-28 : 18:04:45
|
| Nope. You need to drop the constraint(s) and foreign key(s) on the column first. |
 |
|
|
SamC
White Water Yakist
3467 Posts |
Posted - 2002-07-28 : 18:14:38
|
| This get's messy then.BOL is vague about this.Is there a way to remove the dependency without explicitly naming it like:ALTER TABLE Users ALTER COLUMN EmployeeType NODEFAULTTo kill the default value to the column, then delete the column withALTER TABLE Users DROP COLUMN EmployeeType??SamC |
 |
|
|
robvolk
Most Valuable Yak
15732 Posts |
Posted - 2002-07-28 : 18:23:34
|
| You'd have to use dynamic SQL to do it. |
 |
|
|
|
|
|