存储过程基础知识汇总
来源:互联网 发布:dt大数据 编辑:程序博客网 时间:2024/05/17 22:32
--查询所有存储过程
select * from sys.objects where type = 'P';
--修改存储过程
alter proc proc_get_student
as
select * from student;
--调用、执行存储过程
exec proc_get_student;
--------------------------------
--创建存储过程
if (exists (select * from sys.objects where name = 'proc_get_student'))
drop proc proc_get_student
go
create proc proc_get_student
as
select * from student;
-----------------------------------
--带参存储过程
if (object_id('proc_find_stu', 'P') is not null)
drop proc proc_find_stu
go
create proc proc_find_stu(@startId int, @endId int)
as
select * from student where id between @startId and @endId
go
exec proc_find_stu 2, 4;
-------------------------------------
--带通配符参数存储过程
if (object_id('proc_findStudentByName', 'P') is not null)
drop proc proc_findStudentByName
go
create proc proc_findStudentByName(@name varchar(20) = '%j%', @nextName varchar(20) = '%')
as
select * from student where name like @name and name like @nextName;
go
exec proc_findStudentByName;
exec proc_findStudentByName '%o%', 't%';
阅读全文
0 0
- 存储过程基础知识汇总
- 存储过程基础知识
- ORACLE存储过程基础知识
- Orcale存储过程基础知识
- 存储过程基础知识
- SQL-存储过程基础知识
- 存储过程基础知识
- oracle 存储过程基础知识
- 分页存储过程汇总
- mysql存储过程汇总
- 存储过程脚本汇总
- sqlsever 浅析存储过程 存储过程基础知识
- oracle 存储过程基础知识1
- oracle 存储过程基础知识2
- oracle 存储过程基础知识3
- SQL server存储过程基础知识
- oracle数据库存储过程基础知识
- 【汇总】存储过程、触发器 资料
- 直接插入排序
- Spring boot + Spring Security CSS静态资源拦截问题
- MySQL学习笔记13分组复制相关概念
- Python_进程(一)
- spring整合kafka项目生产和消费测试结果记录(一)
- 存储过程基础知识汇总
- leetcode java 实现String to Integer
- 求包含a~z中多个字符的字符串中重复出现最多的字母及次数问题
- luogu P3613 睡觉困难综合征
- STM32F103RC单片机ADC中的间断模式(Discontinous mode)的使用
- 免费论文查重
- ggplot2:bar-数值型(连续型)变量处理
- Qt与Python的混合编程相关配置以及问题说明
- CentOS搭建SVN服务器及使用Eclipse连接SVN服务器