s.mirzaei1990
Starting Member
12 Posts |
Posted - 2014-08-06 : 11:05:11
|
this store procedure is for adding for 2 tables.ALTER PROCEDURE [dbo].[NewMember] -- Add the parameters for the stored procedure here @NationalCode char(10), @Firstname nvarchar(100), @Lastname nvarchar(200), @Gender nvarchar(10), @Fathername nvarchar(100), @BirthYear numeric, @BirthMonth smallint, @BirthDay smallint, @Resume nvarchar(max), @MembershipYear decimal, @MembershipMonth smallint, @MembershipDay smallint, @ExpireYear decimal, @ExpireMonth smallint, @ExpireDay smallintASBEGIN -- SET NOCOUNT ON added to prevent extra result sets from -- interfering with SELECT statements. SET NOCOUNT ON; BEGIN TRANSACTION INSERT INTO People VALUES (@NationalCode,@Firstname,@Lastname,@Gender,@Fathername,@BirthYear,@BirthMonth,@BirthDay,@Resume) INSERT INTO Members VALUES (@NationalCode,@MembershipYear,@MembershipMonth,@MembershipDay,@ExpireYear,@ExpireMonth,@ExpireDay) COMMIT --ROLLBACKENDmust i make this store procedure for update ?create updateMembers @NationalCode char(10), @Firstname nvarchar(100), @Lastname nvarchar(200), @Gender nvarchar(10), @Fathername nvarchar(100), @BirthYear numeric, @BirthMonth smallint, @BirthDay smallint,ASBEGINUPDATE peopleset NationalCode=@NationalCode Firstname=@Firstname Lastname=@Lastname Gender=@Gender Fathername=@Fathername BirthYear=@BirthYear BirthMonth=@BirthMonth BirthDay=@BirthDay for second table (members), what to do? |
|
|