Viewing a SQL SERVER user defined SQL function:
Enter following command to see the sql code :
sp_helptext 'functname'