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! - - - - - -
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