文章详情

  • 游戏榜单
  • 软件榜单
关闭导航
热搜榜
热门下载
热门标签
php爱好者> php文档>mssql2000对列的一些操作

mssql2000对列的一些操作

时间:2010-09-27  来源:leqoqo

表名:AlterAtion 列名:ZXBK 约束名:DF_AlterAtion_ZXBK

----添加一列

alter table AlterAtion  add ZXBK varchar(20)

----删除一列

alter table AlterAtion  drop column ZXBK

----修改一列(当改列有约束条件时,先删约束)

Alter table AlterAtion alter cloumn ZZBM nvarchar(50) null

----重命名一列

exec sp_rename AlterAtion.ZXBK ,'ZXBK 1','Column'

----删除改列的约束

select b.name from syscolumns a,sysobjects b where a.id=object_id(‘AlterAtion’) and b.id=a.cdefault and a.name='ZXBK' and b.name like 'DF%' --删除约束

 

alter table AlterAtion drop constraint DF_AlterAtion_ZXBK

----添加一个约束

alter table AlterAtion add constraint DF_AlterAtion_ZXBK default('1') for ZXBK

相关阅读 更多 +
排行榜 更多 +
别惹神枪手安卓版

别惹神枪手安卓版

冒险解谜 下载
坦克战争世界

坦克战争世界

模拟经营 下载
丛林反击战

丛林反击战

飞行射击 下载