boutiquehoogl.blogg.se

Option recompile stored procedure
Option recompile stored procedure










option recompile stored procedure

For example, the process used by an application named orders can be named orderproc 1、orderproc Etc. Number: is an optional integer used to group procedures with the same name so that the procedures in the same group can be removed together with a drop procedure statement. Parameters for creating stored procedure:ġ.procedure_ Name: the name of the stored procedure, preceded by # as a local temporary stored procedure and # as a global temporary stored procedure.Ģ. ]ĮXECUTE Procedure_ Name ” - if the stored procedure has a parameter, the format of the parameter is: parameter name = value, or it can be the parameter value directlyĭrop procedure procedure_ Name - you can call another stored procedure in a stored procedure, but you cannot delete another stored procedure

option recompile stored procedure

The following describes the basic syntax of stored procedure.Įxplanation of syntax and parameters of stored proceduresĬREATE PROC procedure_name Summary: in a word, stored procedure is a good thing, which is a necessary weapon when doing projects. Through stored procedures, unauthorized users can indirectly access the database under control, so as to ensure the security of data. A stored procedure can replace a lot of T-SQL statements when the program interacts in the network, so it can also reduce the traffic of the network and improve the communication rate.ģ.

#Option recompile stored procedure code

However, the stored procedure is a compiled code block, so the execution efficiency is higher than that of T-SQL statement.Ģ. When the database executes actions, it is compiled before execution. These T-SQL statement codes realize some functions like a method (addition, deletion, modification and query of a single table or multiple tables), and then give a name to this code block, Just call him when you use this function.ġ. It is a code block composed of some T-SQL statements. –What is a stored procedure: a stored procedure can be said to be a recordset.












Option recompile stored procedure