码迷,mamicode.com
首页 > 其他好文 > 详细

添加学员存储过程

时间:2019-01-09 19:27:35      阅读:216      评论:0      收藏:0      [点我收藏+]

标签:values   objects   create   pre   end   过程   cts   val   RoCE   

use StudentManager
go
if exists(select * from sysobjects where name=usp_AddStudent)
    drop procedure usp_AddStudent
go
create procedure usp_AddStudent
@studentName varchar(20),
@Gender char(2),
@Birthday smalldatetime,
@StudentIdNo numeric(18,0),
@PhoneNumber varchar(50),
@StudentAddress varchar(500),
@ClassId int
as
    insert into Students(studentName,Gender,Birthday,StudentIdNo,PhoneNumber,StudentAddress,ClassId)
            values(@studentName,@Gender,@Birthday,@StudentIdNo,@PhoneNumber,@StudentAddress,@ClassId) 
go

--测试存储过程
exec usp_AddStudent 小赵,,1988-09-09,120226198808091217,‘‘,‘‘,2

select * from Students

 

添加学员存储过程

标签:values   objects   create   pre   end   过程   cts   val   RoCE   

原文地址:https://www.cnblogs.com/Spinoza/p/10246281.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!