Click here to Skip to main content
15,886,639 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more: , +
Hello,
I am new for Store procedure,i am trying to insert and fetch data from databse using Store Procedures.How to do this,How to get return from store procedure.
My Table is Tbl_Info
InfoId int,FirstName varchar(50),LastName varchar(50),City varchar(50),Dob datetime
Posted

You need to check some tutorial and basic articles on stored procedures first to know how it works.

http://www.sqlteam.com/article/stored-procedures-returning-data[^]
 
Share this answer
 
Comments
Dylan Morley 22-Feb-11 6:04am    
good article - think I've linked people to that as well
CREATE PROCEDURE PROCNAME   
@CountryId integer ,
@CountryName VARCHAR(200) ,
@nType integer
AS
BEGIN
IF @nType=1
  INSERT INTO Country VALUES(@CountryId,@CountryName);
ELSE IF @nType=2
  UPDATE Country SET CountryName=@CountryName WHERE CountryId=@CountryId;
ELSE IF @nType=0
DELET FROM Country WHERE CountryId=@CountryIdEND
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900