日期:2014-05-18 浏览次数:20578 次
create database spdb3 create table stu3 (stuId nvarchar(40) primary key , stuSex nchar(1) check (stuSex in('男','女')) default '男' , stuName nvarchar(30) not null , stuAge int check(stuAge>1), stuJg nvarchar(40) , stuDept nvarchar(40) ) insert into stu (stuid,stusex,stuname,stuage,stujg,studept) values ('006','男','孙悟空','500','湖北','少林') select * from stu
------解决方案--------------------
--try insert into stu (stuid,stusex,stuname,stuage,stujg,studept) values ('006','男','孙悟空','500','湖北','少林')
------解决方案--------------------
+1
create database spdb1 go use spdb1 go create table stu (stuId nvarchar(40) primary key , stuSex nchar(1) check (stuSex in('男','女')) default '男' , stuName nvarchar(30) not null , stuAge int check(stuAge>1), stuJg nvarchar(40) , stuDept nvarchar(40) ) go insert into stu values ('001','男','孙悟空',500,'湖北','少林'); go
------解决方案--------------------
实在没看出有问题,不过哦,你的脚步,是不是缺了一个 use database,然后create的时候执行也是错误的,正好你的那个查询中有那个表,列名不匹配,……,哇,估计被我猜中了。