Creating update stored procedure….!


Hi All this is code for the stored procedure for updation…. ENJOY
 
First you have to declare the variable which recieve values with @ sign…… and for a variable which does not recieve value but get value from within the stored procedure, the keyword is DECLARE
 
so here’s the code this code needs 4 parameters which needs to be sent with the query…. and one is calculated one….
 

@ProjectCode varchar(50),

@ProjectName

varchar(50),

@TeamMembers

varchar(50),

@ChangerIndex varchar(50)

AS

DECLARE @OldProjectID int

SELECT @OldProjectID = ProjectID FROM TblProjects WHERE ProjectCode=@ChangerIndex

UPDATE tblprojects

SET ProjectName=@ProjectName,

ProjectCode=@projectCode

WHERE ProjectID=@OldProjectID

RETURN

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: