if exists(select * from sysobjects where name='jobs' and xtype='u')
drop table jobs
go
create table jobs(
  id int identity(1,1) primary key clustered,
  name varchar(10) default'OK'
)
go
sp_help jobs
alter table jobs
   drop column name
go
sp_help jobs
执行后出错:
Server: Msg 5074, Level 16, State 1, Line 2
对象 'DF__jobs__name__7C1A6C5A' 依赖于 列 'name'。
Server: Msg 4922, Level 16, State 1, Line 2
ALTER TABLE DROP COLUMN name 失败,因为有一个或多个对象访问此列。