您好,欢迎访问三七文档
当前位置:首页 > 商业/管理/HR > 经营企划 > 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
本文标题:SQL的存储过程语句,查询插入删除修改语句
链接地址:https://www.777doc.com/doc-2860483 .html