当前位置:网站首页>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'边栏推荐
- Write an example of goroutine and practice Chan at the same time
- Once spark reported an error: failed to allocate a page (67108864 bytes), try again
- pytorch Default process group is not initialized
- Keep 2 decimal places after multiplying SQLSEVER fields
- NoViableAltException([email protected][2389:1: columnNameTypeOrConstraint : ( ( tableConstraint ) | ( columnNameT
- multiprocessing.pool详解
- 2022 CISP-PTE(一)文件包含
- Convolution neural network -- Application of CNN model (ore prospecting prediction)
- Redis cache penetration, cache breakdown, cache avalanche
- Tar: /usr/local: cannot find tar in the Archive: due to the previous error, it will exit in the last error state
猜你喜欢

IDEA中关于Postfix Completion代码模板的一些设置

Park and unpark in unsafe

Yolov6's fast and accurate target detection framework is open source

MPC control of aircraft wingtip acceleration and control surface

POI replacing text and pictures in docx

Caldera installation and simple use

Fast realization of Bluetooth communication between MCU and mobile phone

Modeling competition - optical transport network modeling and value evaluation

快速实现单片机和手机蓝牙通信

【毕业季】毕业是人生旅途的新开始,你准备好了吗
随机推荐
TiDB 数据库快速上手指南
Unrecognized VM option ‘‘
网关状态检测 echo request/reply
2022 CISP-PTE(一)文件包含
第 299 场周赛 第四题 6103. 从树中删除边的最小分数
快速实现蓝牙iBeacn功能详解
面试官:用分库分表如何做到永不迁移数据和避免热点问题?
SQL 注入绕过(一)
OPPO面试整理,真正的八股文,狂虐面试官
Crawler learning 5--- anti crawling identification picture verification code (ddddocr and pyteseract measured effect)
IDEA一键生成Log日志
面试官:大量请求 Redis 不存在的数据,从而打倒数据库,你有什么方案?
poi导出excle
OpenCV怎么下载?OpenCV下载后怎么配置?
HTAP Quick Start Guide
[QT notes] basic use of qregularexpression in QT
tracepoint
Cloud-Native Database Systems at Alibaba: Opportunities and Challenges
2022 CISP-PTE(一)文件包含
Memory barrier store buffer, invalid queue