Parameterized Stored Procedure For Insert in SQL 2008

In this article i will explain how to insert values in table with the help of Parameterized Stored Procedure.
  • 2391

Introduction

Parametrized Stored Procedure

These accept One or more Parameters. It is important that data type of parameters should be same as the data type in tables.

Parametrized Stored Procedure for Insert

With the help of Parametrized Stored Procedure for insert, we can insert a values in a table.

Example

The following example illustrates how to insert a new employee in a Employee table that has a id, F_Name, L_Name, Salary, City and Region field.

Suppose we have table named Employee as.

CreateTable-in-sqlserver.jpg

Create Procedure to insert values

SP-for-insert-in-SQL.jpg

Execute Stored Procedure

Execute-SP-In-SQL.jpg


OUTPUT

Insert-SP-Output-in-SQL.jpg

© 2020 DotNetHeaven. All rights reserved.