September 2010
Intermediate to advanced
1704 pages
111h 8m
English
You can view the source code for stored procedures in SQL Server 2008 by querying the definition column of the object catalog view sys.sql_modules or by using the system procedure sp_helptext (see Listing 28.9).
Listing 28.9 Viewing Code for a Stored Procedure by Using sp_helptext

By default, all users have permission to execute sp_helptext to view the SQL code for the stored procedures in a database. If you want to protect the source code of stored procedures and keep its contents from prying eyes, you can create a procedure by using the WITH ENCRYPTION option. When this option is specified, the source code stored ...