[Studentid] [int] IDENTITY(1,1) NOT NULL,
[Firstname] [nvarchar](200) NOT NULL,
[Lastname] [nvarchar](200) NULL,
[Email] [nvarchar](100) NULL
)
Values(‘Vivek’, ‘Johari’, ‘vivek@abc.com’)
Insert into tbl_Students (Firstname, lastname, Email)
Values(‘Pankaj’, ‘Kumar’, ‘pankaj@abc.com’)
Insert into tbl_Students (Firstname, lastname, Email)
Values(‘Amit’, ‘Singh’, ‘amit@abc.com’)
Insert into tbl_Students (Firstname, lastname, Email)
Values(‘Manish’, ‘Kumar’, ‘manish@abc.comm’)
Insert into tbl_Students (Firstname, lastname, Email)
Values(‘Abhishek’, ‘Singh’, ‘abhishek@abc.com’)
(
AS
BEGIN
SELECT Firstname+’ ‘+Lastname FROM tbl_Students WHERE studentid=@studentid
END
(
@studentid INT, –Input parameter , Studentid of the student
@studentname VARCHAR(200) OUT — Out parameter declared with the help of OUT keyword
)
AS
BEGIN
SELECT @studentname= Firstname+’ ‘+Lastname FROM tbl_Students WHERE studentid=@studentid
END
(
@studentid INT, –Input parameter , Studentid of the student
@studentname VARCHAR (200) OUT, — Output parameter to collect the student name
@StudentEmail VARCHAR (200)OUT — Output Parameter to collect the student email
)
AS
BEGIN
SELECT @studentname= Firstname+’ ‘+Lastname, @StudentEmail=email FROM tbl_Students WHERE studentid=@studentid
END
(
@StudentFirstName Varchar(200),
@StudentLastName Varchar(200),
@StudentEmail Varchar(50)
)
As
Begin
Insert into tbl_Students (Firstname, lastname, Email)
Values(@StudentFirstName, @StudentLastName,@StudentEmail)
End
Exec Getstudentname 1
Declare @Studentemail as nvarchar(50) — Declaring the variable to collect the Studentemail
Execute GetstudentnameInOutputVariable 1 , @Studentname output, @Studentemail output
select @Studentname,@Studentemail — “Select” Statement is used to show the output from Procedure
good post.. very helpful.. thanks
Thanks CJ, for your valuable comment:-) It will really motivate me to share my knowledge with more posts.
realy nice and helpful..
thanks
very very useful for beginners.. simple and easy to understand.. these kinds of info means a lot to a beginner like me…
Very helpul
Thanks
Thanks for this article. You have explained it very nicely. I came to know about this blog through your article in the CodeProject. You have great many articles in you blog. Expects more and more article from you.
Thanks Pramod for your valuable comments
Nice Post, thank you very much for sharing.
sir awesome
Difficult to understand Trigger could u help me with this
This article will help you in understanding the triggers
http://www.techmixing.com/2018/12/sql-triggers-introduction.html
Very useful. Thanks for the detailed explanation.
Keep it up Vivek
http://wwww.aicom.com/wp-content/_input_3_Tips_on_How_to_Formulate_the_Thesis_Structure_Properly.html
Nice and informative post. Thank you for sharing.