当前位置:网站首页>sql sever列名或所提供值的数目与表定义不匹配
sql sever列名或所提供值的数目与表定义不匹配
2022-06-27 06:36:00 【CSDN问答】
消息 213,级别 16,状态 1,过程 usp_BorrowBook,行 36 [批起始行 2]
列名或所提供值的数目与表定义不匹配。(这个怎么解决!!1)
这是我sql sever的代码
use BookDBGOALTER procedure usp_BorrowBook @rdID char(9), @bkID char(9)as if not exists(select * from Book where @bkID in (select bkID from Book)) begin raiserror('图书馆没有该书,借阅失败',10,1) return end if not exists(select * from Reader where @rdID in (select rdID from Reader)) begin raiserror('图书馆没有该读者,借阅失败',16,1)WITH NOWAIT return end declare @bkStatus int select @bkStatus = bkStatus from Book where bkID = @bkID if @bkStatus =0 begin raiserror('该书不在馆,无法借阅',16,1)WITH NOWAIT return end declare @rdBorrowQty int,@canLendQty int select @rdBorrowQty = rdBorrowQty from Reader where rdID = @rdID select @canLendQty = canLendQty from ReaderType where rdType = (select rdType from Reader where rdID = @rdID) if @rdBorrowQty = @canLendQty begin raiserror('抱歉!你所借书的数量已经达到最大借书数量!借阅失败!',16,1) WITH NOWAIT return end update Book set bkStatus = 0 where bkID = @bkID update Reader set rdBorrowQty = rdBorrowQty + 1 where rdID = @rdID declare @canLendDay int select @canLendDay = canLendDay from ReaderType where rdType = (select rdType from Reader where rdID = @rdID) insert into Borrow values(@rdID,@bkID,GETDATE(), DATEADD (dd, @canLendDay,GETDATE())) exec usp_BorrowBook 'rd2019002','bk2019002'边栏推荐
- 快速实现Thread Mesh组网详解
- Visual Studio VS 快捷键使用大全
- 2022 CISP-PTE(二)SQL注入
- NoViableAltException([email protected][2389:1: columnNameTypeOrConstraint : ( ( tableConstraint ) | ( columnNameT
- Redis 缓存穿透、缓存击穿、缓存雪崩
- HTAP in depth exploration Guide
- Spark SQL common time functions
- [graduation season] graduation is the new beginning of your life journey. Are you ready
- Basic SQL operations in tidb
- DMU software syntax highlighting VIM setting -- Learning Notes 6
猜你喜欢

解决 Win10 Wsl2 IP 变化问题

小米面试官:听你说精通注册中心,我们来聊 3 天 3 夜

Fast implementation of thread mesh networking

面试官:用分库分表如何做到永不迁移数据和避免热点问题?

聊聊领域驱动设计
![[graduation season] graduation is the new beginning of your life journey. Are you ready](/img/4e/aa763455da974d9576a31568fc6625.jpg)
[graduation season] graduation is the new beginning of your life journey. Are you ready

2022 le fichier CISP - Pte (i) contient:

机 器 学 习

MPC control of aircraft wingtip acceleration and control surface

Machine learning
随机推荐
HTAP Quick Start Guide
TiDB与 MySQL 兼容性对比
POI 替换docx中的文字和图片
Quick realization of Bluetooth ibeacn function
分数阶PID控制
2022 CISP-PTE(一)文件包含
Easyexcel: read Excel data into the list set
The song of cactus -- throwing stones to ask the way (1)
Fast implementation of thread mesh networking
进程终止(你真的学会递归了吗?考验你的递归基础)
One year's experience of technical personnel in Entrepreneurship
从5秒优化到1秒,系统飞起来了...
观测电机转速转矩
内存屏障今生之Store Buffer, Invalid Queue
Caldera安装及简单使用
Active learning
Centos7.9安装mysql 5.7,并设置开机启动
写一个 goroutine 实例, 同时练习一下 chan
研究生数学建模竞赛-无人机在抢险救灾中的优化应用
机 器 学 习