Hides the source text for the specified compiled object, as well as the text of computed columns, predicates, and function-based index keys. sp_hidetext also encrypts the text for user-defined functions.
sp_hidetext [objname[, tabname[, username]]]
sp_hidetext
sp_hidetext @objname = "sp_sort_table", @username = "Mary"
sp_hidetext "pr_phone_list"
sp_hidetext @tabname = "my_tab"
sp_hidetext "my_vu", "my_tab"
sp_hidetext @username = "Tom"
sp_hidetext hides the source text for the specified compiled object.
If you do not provide any parameters, sp_hidetext hides the source text for all compiled objects in the current database.
sp_helprotect ... expand_predicate prints a null predicate if text has been hidden.
Hidden syscomments.text is not available for use by sp_helprotect.
The SAP ASE server allows the predicate owner or the SSO to hide the text of a predicate. Hidden syscomments.text is not available for use by sp_helprotect. Users must be warned that the expand_predicate option of sp_helprotect prints a null predicate if text has been hidden.
If you use sp_hidetext followed by a cross-platform dump and load, you must manually drop and re-create all hidden objects.
dump database, dump transaction, load database, load transaction in Reference Manual: Commands
Transact-SQL User’s Guide for more information about hiding source text.
The permission checks for sp_hidetext differ based on your granular permissions settings.
Setting | Description |
---|---|
Enabled | With granular permissions enabled, you must be a user with manage database privilege. Any user can execute sp_hidetext to hide the source text of their own compiled objects. |
Disabled | With granular permissions disabled, you must be the datatype owner or a user with sa_role. Any user can execute sp_hidetext to hide the source text of their own compiled objects. |
Values in event and extrainfo columns from the sysaudits table are:
Information | Values |
---|---|
Event | 38 |
Audit option | exec_procedure |
Command or access audited | Execution of a procedure |
Information in extrainfo |
|