main Difference between returns and return ? what use this keyword give one example ...........
Thanks
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Abhinav Pal13 reputationPosted Oct 16, 2015, 3:45 AM EDT
RETURN can be used any where in t-sql.It will immediately stop the execution from the point where RETURN keyword is found and will not execute further lines of t-sql code. Additionally RETURN keyword can also return some value out from the procedure stopping the execution from there.
RETURNS is limited to scalar and table valued functions defining the return type information. Like below
CREATE FUNCTION xyz(@minId int) -- input parameter
RETURNS @tableXYZ TABLE (
Id int NOT NULL,
Modified datetime NULL
)
AS
BEGIN
Insert into @tableXYZ
Select 1, getdate ()
RETURN;
Priyaranjan K SRank #45 · 32.5K reputationPosted Oct 16, 2015, 3:20 AM EDT