排名
6
文章
6
粉丝
16
评论
8
{{item.articleTitle}}
{{item.blogName}} : {{item.content}}
ICP备案 :渝ICP备18016597号-1
网站信息:2018-2025TNBLOG.NET
技术交流:群号656732739
联系我们:contact@tnblog.net
公网安备:
50010702506256


欢迎加群交流技术

前言
什么是存储过程?
优点:
1.有点类似C#里的方法,封装性,减少sql语句代码量。
2.存储过程只在创造时进行编译,以后每次执行存储过程都不需要再重新编译,而一般的SQL语句每执行一次就编译一次,所以从效率上来说
存储过程可以提高执行速度。
3:安全性高,可以设定只有某个用户才能使用该存储过程
缺点:
不易维护。
可移植性不好
使用场景:简单说来就是sql执行次数不大,能不用就不用,执行比较繁琐,维护也很麻烦,可移植性不好
编写一个简单的存储过程
创建
create procedure GetUsers as begin select * from UserInfo; end;
调用
execute GetUsers;
删除
drop procedure GetUsers;
评价