请问:如何修改带有约束的属性列的数据类型? 在企业管理器 选中表student 右击 选设计表 看到sname字段 把8改为10就行了 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 --查看约束exec sp_helpindex studentgo--删除unique约束alter table student drop constraint 约束名go--修改列alter table student alter column sname char(10)go--添加约束alter table student add constraint UQ__student_sname unique(sname) 一种是用企业管理器 ,选中表student 右击 选设计表 看到sname字段 把8改为10就行了二就是用sql语句, 先删除约束 alter table student drop constraint 修改列 alter table student alter column sname char(10) 然后再添加 alter table student add constraint UQ__student_sname unique(sname) 最后用 DBCC CHECKTABLE ('student')刷新 初级问题 EXEC SQL SELECT 的问题 求一个存储过程。 如何合并数据---SQL,重发一次 问个存储过程方面的问题 到底学那种数据库开发工具? 删除重复记录的特殊情况 OLAP 和 数据挖掘 的基础问题 sql语句请教 高分求助!!!SQL Server里面有没有给查询结果前补空格或者后补空格的函数???? 这个表该怎么建? sql server 数据库恢复问题,急等!!!请各位帮忙!! 请教备份的问题
exec sp_helpindex student
go--删除unique约束
alter table student drop constraint 约束名
go--修改列
alter table student alter column sname char(10)
go--添加约束
alter table student add constraint UQ__student_sname unique(sname)
先删除约束 alter table student drop constraint 修改列 alter table student alter column sname char(10) 然后再添加 alter table student add constraint UQ__student_sname unique(sname) 最后用 DBCC CHECKTABLE ('student')刷新