Using Stored Procedures In MSSQL

Today, I want to talk about using stored procedures in MsSql. First let me explain why we need Stored procedures. Stored procedure means, SQL statements that are kept in the database and compiled in the first run and do not need to be recompiled later. We will do it by procedures.

Procedures has a lot of advantages. Main one is it’s working very fast. Because it only compiles once and no need to compile again. And you can also use if else while operations in the stored procedures.

Let start creating a simple procedure.

We define a procedure which has a parameter. This parameter helps us to get the named users. And we will run this procedure by the following code.

That’s all so easy. You can create more complex procedures which has input parameters and output parameters.  Procedures are especially very useful for your reporting requirements. If you are looking for triggers in MsSql, have a look at Triggers In MsSql

If you have question do not forget to write from the chat button next to it or from the comment.

You may also like...

2 Responses

  1. March 7, 2019

    […] If you are searching for Stored Procedures, have a look at this post: Stored Procedures In MsSql […]

  2. April 17, 2019

    […] Thats all for subquerying in Oracle.  If you have interested about MS SqlServer you can have a look at my other post Using Stored Procedures In MSSQL […]

Leave a Reply

Your email address will not be published. Required fields are marked *