Creating a Stored Procedure for Insertion….!


Hi All…. This code shows us how to write a stored procedure…. First of all we have to define parameters which must be of same data type as of SQL DataBase….
 
 

ALTER PROCEDURE SP_CreateProjectTeam

@ProjectCode

varchar(50),

@ProjectName

varchar(50),

@TeamMembers varchar(50)

AS

/* SET NOCOUNT ON */

INSERT INTO TblProjects

(ProjectCode, ProjectName)

VALUES (@ProjectCode,@ProjectName)

INSERT INTO

TblProjectTeams

(Members, ProjectCode)

VALUES

(@TeamMembers,@ProjectCode)

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: