Wednesday, July 15, 2020

HOW TO CREATE A STORED PROCEDURE IN SQL SERVER

Stored Procedure is a sql statements that you can write your own logic with sql commands or modify an existing stored procedures. It is a pre-compiled format and it also improves the performance while accessing data from database. Stored procedures are cached and can be reused. So here we will see that how we can create a new stored procedure in sql server. The process is as follows:

Step 1: Open the database that you created in your system.

Step 2: Click on the Programmability menu then you will see the Stored Procedure option and right click on it then you will see an option i.e. Stored Procedure. Please see the below screenshot.


After click on stored procedure, you will go to a new query window on where you can write sql statements or logic. Please see the below screenshot.


So, now you will create a procedure to add a new employee into an Employee table. Please see it below.


When you will be done with your changes in procedure then you have to execute a complete query at once by pressing F5. After that, your procedure would be create successfully.


                                  - - - - - - Cheers, Happy to Help! - - - - - - 

No comments:

Post a Comment

DIFFERENCE BETWEEN CHAR AND VARCHAR IN SQL SERVER

CHAR:  The  CHAR datatype is a fixed length data type in sql server. It is used to store fixed length type of string data or character strin...