It's too easy.缺省值是約束.
先這樣取得表中約束的名字:
select name from sysobjects where xtype = 'D' and parent_obj = object_id('你的表名');然後:
alter table TableName drop 得到的約束名;
先這樣取得表中約束的名字:
select name from sysobjects where xtype = 'D' and parent_obj = object_id('你的表名');然後:
alter table TableName drop 得到的約束名;
select cate from sysobjects where xtype = 'D' and parent_obj = object_id('exten');注:我的exten表格中有cate列呀。提示如下代码:Server: Msg 207, Level 16, State 3, Line 1
Invalid column name 'cate'.另外,还有一个问题请教:在SQL SERVER中如何创建一序号(ID)列??
该序号(ID)按1、2、3、4......等一直排列。
要求:必须使已经拥有的几千行数据的序号(ID)列自动按序号排列,而不必手工输入序号。并且具有惟一属性值。
各位高手,帮帮忙呀!!!!!!!!!!
select name ...
你為什麼要改成:
select cate ...SQL Server中有個identity屬性可以自動增1,如:
create table a
(
a1 int identity(1,1),
a2 varchar(6)
)
然後在insert時:
insert into a values('hello!'); --不用管a1,系統會幫你自動增1