1. 程式人生 > >添加學員存儲過程

添加學員存儲過程

存儲 nta val res exists small manage manager cts

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

添加學員存儲過程