摘要:
----视图增删改操作不影响基础表 ----视图不允许出现重复列 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... 阅读全文
摘要:
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 --( ... 阅读全文
摘要:
--存储过程 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... 阅读全文
摘要:
--定义变量 --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--... 阅读全文