December 2013
Intermediate to advanced
1872 pages
153h 31m
English
Besides using T-SQL commands to create functions, you can also use them to view and modify functions. You can get information by using the provided system procedures and queries against system views. The following sections describe these methods.
There are multiple methods to view the source code for a user-defined function. One way is to use the sp_helptext procedure:
use AdventureWorks2012goexec sp_helptext getonlydategoText--------------------------------------------------------------------CREATE FUNCTION getonlydate ()RETURNS datetimeASBEGIN RETURN (select convert(datetime, convert(date, getdate())))END
Note
To display the source ...