SQL的存储过程语句,查询插入删除修改语句

整理文档很辛苦,赏杯茶钱您下走!

免费阅读已结束,点击下载阅读编辑剩下 ...

阅读已结束,您可以下载文档离线阅读编辑

资源描述

2、创建存储过程Custom表:CREATEPROCEDUREcustomshowasSELECT@cid=id,@ccname=cname,@cdepartID=departID,@cage=age,@cename=ename,@cpassword=passwordfromcustomCREATEPROCEDUREcustomquery(@cidint)asSELECTid,cname,departID,age,ename,passwordfromcustomwhereid=@cidCREATEPROCEDUREcustominsert(@cidint,@ccnamenvarchar(50),@cdepartIDint,@cageint,@cenamenvarchar(50),@cpasswordnvarchar(50))asINSERTintocustomVALUES(@cid,@ccname,@cdepartID,@cage,@cename,@cpassword)CREATEPROCEDUREcustomdelete(@cidint)asDELETEFROMcustomwhereid=@cidCREATEPROCEDUREcustomupdate(@cidint,@ccnamenvarchar(50),@cdepartIDint,@cageint,@cenamenvarchar(50),@cpasswordnvarchar(50))asUPDATEcustomSETcname=@ccname,departID=@cdepartID,age=@cage,ename=@cename,password=@cpasswordwhereid=@cidCREATEPROCEDUREdepartmentshowasSELECTid,departname,descriptionfromdepartmentCREATEPROCEDUREdepartmentquery(@didint)asSELECTid,departname,descriptionfromdepartmentwhereid=@didCREATEPROCEDUREdepartmentinsert(@didint,@ddepartnamenvarchar(50),@ddescriptionnchar(10))asINSERTintodepartmentVALUES(@did,@ddepartname,@ddescription)CREATEPROCEDUREdepartmentdelete(@didint)asDELETEFROMdepartmentwhereid=@didCREATEPROCEDUREdepartmentupdate(@didint,@ddepartnamenvarchar(50),@ddescriptionnchar(10))asUPDATEdepartmentSETid=@did,departname=@ddepartname,description=@ddescription

1 / 6
下载文档,编辑使用

©2015-2020 m.777doc.com 三七文档.

备案号:鲁ICP备2024069028号-1 客服联系 QQ:2149211541

×
保存成功