摘要: ----视图增删改操作不影响基础表 ----视图不允许出现重复列 create view haha--创建视图 as select student.*,Score.Cno,Score.Degree from student,score where student.Sno=Score.Sno select * from haha ----事务 begin tran insert into... 阅读全文
posted @ 2018-01-19 22:11 Int64 阅读(145) 评论(0) 推荐(0) 编辑
摘要: 1 --create table users--创建用户表 2 --( 3 -- ids int primary key identity(1,1), 4 -- name nvarchar(200),--姓名 5 -- class nvarchar(200)--班级编号 6 --) 7 8 --create table class--创建班级表 9 --( ... 阅读全文
posted @ 2018-01-19 21:10 Int64 阅读(296) 评论(0) 推荐(0) 编辑
摘要: --存储过程 create proc JiaFa--创建加法存储过程 @a int, @b int as return @a+@b; declare @ccc int; exec @ccc=JiaFa 5,10--调用存储过程 select @ccc create proc SelectAll--创建查询表存储过程 as select * from student s... 阅读全文
posted @ 2018-01-19 18:42 Int64 阅读(132) 评论(0) 推荐(0) 编辑
摘要: --定义变量 --int a; declare @a nvarchar(200); declare @b nvarchar(200); declare @c int; --赋值 --a=""; set @a='haha'; select @b=MAX(DEGREE) from Score select @c=1; --输出 --console.write(s); select @a--... 阅读全文
posted @ 2018-01-19 17:39 Int64 阅读(263) 评论(0) 推荐(0) 编辑