I want to hide the script of a stored procedure in SQL Server 2008

后端 未结 4 1484
温柔的废话
温柔的废话 2021-02-15 14:27

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

4条回答
  •  走了就别回头了
    2021-02-15 15:20

    You're looking for WITH ENCRYPTION, which encrypts the code behind your stored proc.

    CREATE PROCEDURE usp_MyProc
    WITH ENCRYPTION
    AS
    SELECT *
    FROM myTable
    

    Just a caveat, from MSDN:

    Users who have no access to system tables or database files cannot retrieve the obfuscated text. However, the text will be available to privileged users who can either access system tables over the DAC port or directly access database files.

    Some references and further reading:

    • http://blog.sqlauthority.com/2007/07/01/sql-server-explanation-of-with-encryption-clause-for-stored-procedure-and-user-defined-functions/
    • http://msdn.microsoft.com/en-us/library/ms187926.aspx

提交回复
热议问题