Stored Procedure
How to write Stored Procedure?provide a sample stored procedure.
3 Answers
Know the answer? Post it. Somebody with the same question will find it here.
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
praveen rapelli26 reputationPosted Jul 3, 2011, 10:20 PM EDT
SELECT * FROM City WHERE cityName='mumbai'
id cityName
1 mumbai
2 Hyderabad
3 pune
USE [DatabaseName]
GO
CREATE Procedure citysearch(@cityname varchar(500))
AS
BEGIN
SELECT * FROM city WHERE cityName=@cityname
END
Exec citysearch @cityname='mumbai'
Note:
citysearch is stored procedure name,@cityname is parameter we are passing
Vilas GiteRank #951 · 2.1K reputationPosted Jul 3, 2011, 10:32 PM EDT
Hi Shalini
Please Refer this one… Store Procedure used in Application with Crystal Report.
http://www.c-sharpcorner.com/UploadFile/73ba73/7161/?ArticleID=63b40f15-b9a8-4e27-a4f1-0625b4be4c55
----------------------------------------------------------------------------------------------------
If this reply hepls your post…then "MARK AS ANSWER"!
Dorababu MekaRank #457 · 5.5K reputationPosted Jul 3, 2011, 11:38 PM EDT
CREATE procedure ProcedurName
(
@Field1 varchar(50),
@Field1 varchar(50)
)
as
insert into your table name
values(@Field1,@Field2)
RETURN
Sample
CREATE procedure Insert
(
@EmpName varchar(50),
@Address varchar(50)
)
as
insert into Employee
values(@EmpName ,@Address )
RETURN