sqlserver 存储过程的新建与执行
2024-09-03 21:22:39
if Exists(select * from sysobjects where NAME = 'insert_custominfo' and type='P')
drop procedure insert_custominfo
go
create proc insert_custominfo
@mid nvarchar(50),
@custominfoid nvarchar(50) output
as
begin
declare @num int
set @num =( select COUNT(*) from t_custominfo where c_id=@mid )
if(@num =0)
begin
insert into t_custominfo(c_id) values(@mid)
set @custominfoid = @@IDENTITY
end
else
begin
select @custominfoid=c_custominfoid from t_custominfo where c_id=@mid
end
end declare @custominfoid int
exec insert_custominfo '',@custominfoid output
print @custominfoid
最新文章
- HttpTool.java(在java tool util工具类中已存在) 暂保留
- RCP:gef智能寻路算法(A star)
- 面向对象编程(十二)——final关键字
- php给一张图片加上水印效果
- HDU 1061 N^N (n的n次方的最后一位)
- python常用函数年初大总结
- 使用ExecutorCompletionService 管理线程池处理任务的返回结果
- 基于mapreduce实现图的三角形计数
- django模型层优化(关联对象) 懒加载和预加载 +长链接
- 小程序获取formid配置模板消息
- HDU5511 : Minimum Cut-Cut
- LOJ121 动态图连通性(LCT)
- 你不知道的JavaScript(中卷) (Kyle Simpson 著)
- shell expect的简单用法【转】
- 【BZOJ】【3931】【CQOI2015】网络吞吐量
- Java(20~24)
- Word里面怎么取消全文每个标题前面都有的这个点
- poj 2195 Going Home(最小费最大流)
- GCC中文错误提示
- UVA 11997 K Smallest Sums 优先队列 多路合并
热门文章
- 【SQL Server性能优化】运用SQL Server的全文检索来提高模糊匹配的效率
- Sqlserver查询每组数据中最大的一条数据
- Java Web-Filter and listener
- R语言学习笔记:glue包实现变量传参
- [书籍翻译] 《JavaScript并发编程》第四章 使用Generators实现惰性计算
- [LeetCode] 219. Contains Duplicate II ☆(存在重复元素2)
- 【Hibernate】抓取策略
- golang GC(一 原理)
- MySQL学习笔记-MHA安装配置
- Microsoft 中间语言