What are the different procedure attributes in SQL server?

1.1K    Asked by JulianSpringer in SQL Server , Asked on Jan 7, 2020
Answered by Rachit Gupta

There are 2 type of attributes which are frequency used:

With Encryption

With recompile

In Encryption : After using this there is no chance of viewing the script of procedure as it is encrypted . and the script will not be visible in syscomments . This is used while installing the application on the client server, as no one can view the procedure../ view etc. So there is no chance of altering or copying the code.

With recompile: in the procedure it generates the best query plan based on the current state and the same query plan will be used after that. But in case we use recomplie feature then it will generate a new query plan on every run. All this will increase the time to generate the query plan but in case there is a lot of difference in query execution every time then we should use it in procedure. For example in case data quantity(gets high or low for different tables) changes regularly. Or there is an addition /removal of index so a new query plan needs to be created.



Your Answer

Interviews

Parent Categories