Stored Procedure
How to write Stored Procedure?provide a sample stored procedure.
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Dorababu MekaPosted Jul 4, 2011, 3:38 AM
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
Vilas GitePosted Jul 4, 2011, 2:32 AM
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"!
praveen rapelliPosted Jul 4, 2011, 2:20 AM
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