Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

DROP COLUMN 失败

0 views
Skip to first unread message

夜阑静

unread,
Jul 7, 2005, 4:24:47 AM7/7/05
to
我在表中添加了一个字段,然后用下面的命令来删掉此字段:

alter table DP_ENP_PERMIT DROP COLUMN ENP_CREATE_DATE

却得到下面的错误信息:


服务器: 消息 5074,级别 16,状态 1,行 1
对象 'DF__DP_ENP_PE__ENP_C__3BA0BFE9' 依赖于 列 'ENP_CREATE_DATE'。
服务器: 消息 4922,级别 16,状态 1,行 1
ALTER TABLE DROP COLUMN ENP_CREATE_DATE 失败,因为有一个或多个对象访问此列。

我在企业管理器中却可以正常删掉,这是为什么?

ICERIVER(林)

unread,
Jul 7, 2005, 5:13:02 AM7/7/05
to
有些用SQL语句来执行不能完成的操作在SQLSERVER的企业管理器里是可以完成的,因为他需要给您提示,在语句状态下是不能给您提示的。
--
酒醒只在花前坐,酒醉換來花下眠;
半醒半醉日復日,花落花開年復年。
別人笑我太瘋癲,我笑他人看不穿;
不見五陵豪傑墓,無花無酒鋤作田。


“夜阑静”编写:

RM

unread,
Jul 7, 2005, 8:33:03 AM7/7/05
to
If you set default constraint for the column, have to drop the default
constraint first.

夜阑静

unread,
Jul 8, 2005, 5:07:02 AM7/8/05
to

"夜阑静" <AAA...@BBBBBBB.com> 写入邮件
news:Ou4O8zs...@TK2MSFTNGP15.phx.gbl...

Billyy

unread,
Jul 12, 2005, 7:38:14 AM7/12/05
to
Drop the 'DF__DP_ENP_PE__ENP_C__3BA0BFE9' first, then drop the column.

In Enterprise Manager, when you click to drop the column, the EM first sends
the "drop default" to SQL Server engine, and then the "drop column"
statement. You can use profiler to demostrate this behavior in EM

“夜阑静”编写:

0 new messages