I have written a stored procedure in SQL Server.
Now its just that I don\'t want any one to see my script or edit it.
Please remember that I am working on the a
Avoid using the WITH ENCRYPTION
option other than for very specified requirements. It may lead to administrative problems later.
Using WITH ENCRYPTION
is not a recommended best practice to hide the definition/code of an object. Luckily, there is an alternative approach for SQL Server.
If it is required to hide the definition/code of any object from a user then standard permissions can be used for this purpose. This can be done by granting or revoking View Definition rights.
If permission View Definition is denied for an object to any user then the user would not be able to view the object in SSMS or view its code through the system stored procedure sp_helptext
.
The View Definition permission may also be used for other objects in SQL Server like tables, synonyms etc. View Definition permissions can be granted or denied using both T-SQL
or SSMS
For implementation of permissions through SSMS :
Denying View Definition
permission will hide the object for a specific user and also the user will not be able to see the definition using sp_helptext
Other permissions like SELECT, INSERT
etc will remain intact.
The permissions are flexible and can be implemented on the following four levels:
Thank you hope it will clear confusion.