2.20存储过程学习笔记
2016-02-20 14:50
211 查看
什么是存储过程?存储过程就是作为可执行对象存放在数据库中的一个或多个sql命令,通俗来讲,存储过程就是能完成一定操作的一组sql语句。
如下为无参数的存储过程
create proc stuprocess
as
begin
select id_p,firstname,lastname,age,city,address from persons
end
go
如下为有参数的存储过程
create proc stuprocess1
@lastname varchar(100)
as
begin
select id_p,address from persons where lastname=@lastname
end
go
exec stuprocess1 'zhangsan'
如下为无参数的存储过程
create proc stuprocess
as
begin
select id_p,firstname,lastname,age,city,address from persons
end
go
如下为有参数的存储过程
create proc stuprocess1
@lastname varchar(100)
as
begin
select id_p,address from persons where lastname=@lastname
end
go
exec stuprocess1 'zhangsan'
相关文章推荐
- 异常2
- linux samba安装及配置
- Android 开发绕不过的坑:你的 Bitmap 究竟占多大内存?
- pcie干货系列之-TLP’s size/TLP fail/4K boundary/requs
- CodeForces-630C. Lucky Numbers
- POJ3273 二分
- 初学者github会遇到的错误
- Android Animations动画使用详解
- 知识点链接
- Hibernate 3中如何获得库表所有字段的名称
- VisualRust + VisualGDB编辑调试Rust
- 猜数字游戏
- 十六进制的字符串与二进制字符串相互转换
- jquery 对象dom 对象互转
- example of Makefile to compile a c source file
- eclipse下的spring环境配置
- 经典SQL语句大全
- 【杭电oj】1875 - 畅通工程再续(克鲁斯塔尔)
- 收入成本预算_直营
- bsoj 2044 【SCOI2007】最大土地面积