Sql Code:create table TS(id int primary key identity(1,1),name varchar(20) unique,sex bit default 1)insert into TS (name) values ('abc')select * from ts1 abc 1其实就是帮定一个约束 我这样写的很简单,一般都是create default aaa as 1 sp_bindefault aaa,'表.字段'
在设计视图无论怎么设置,? --视图也表无关 ------------------- create table t(Col bit default 1) insert t values(default) go select * from t/* Col ---- 1(所影响的行数为 1 行)*/ -- create view v_t as select * from t go create view v_t as select col1=0 from t
ALTER TABLE xxx ALTER COLUMN yy BIT NOT NULL DEFAULT 1
我这样写的很简单,一般都是create default aaa as 1
sp_bindefault aaa,'表.字段'
--视图也表无关
-------------------
create table t(Col bit default 1)
insert t values(default)
go
select * from t/*
Col
----
1(所影响的行数为 1 行)*/
--
create view v_t
as
select
*
from
t
go
create view v_t
as
select
col1=0
from
t