Sample SQL Manual
Sample SQL Manual
C UOG
Now let see The Stored procedure for the above table to Insert, Update, Select and Delete
data from a table………………….
Syntax to create procedure
create proc (procedure) Name(
@column name datatype,
As
Begin
Activity………………
End
)
For Inserting Data into Student Table:-
create proc [dbo].[InsertintoStudent]
@StudID nvarchar(50) ,
@FirstName nvarchar(99),
@FatherName nvarchar(99),
@Sex nvarchar(99),
Prepared by Aleka M.
1
SQL Lab Manual 2012E.C UOG
@Age int
as
begin
insert into Student values(@StudID ,@FirstName ,@FatherName,@ Sex, @ Age )
insert into [Login] values (@StudID ,@StudID ,'Student') Commented [M1]: To insert data into login table that
end values are taken from student table…..
Prepared by Aleka M.
2
SQL Lab Manual 2012E.C UOG
begin
insert into FeedBack values(@StudID,,GETDATE(),@Comment) Commented [M2]: To insert current data form the PC
end
Prepared by Aleka M.
3