title: How to view a stored function - SQL Server
body: <p>Version: SQLServer 8</p>
  
  <p>I would like to view the contents of a stored function in sqlserver, i.e. what exactly the function is doing.</p>
  
  <p>None of the options listed <a href="https://stackoverflow.com/questions/468672/sql-server-where-is-sys-functions">here</a> work for me. There doesn't appear to be any database/table called sys.objects. I was able to query the information_table.routines table, but that does not contain the function that I am looking for. My function is located in:</p>
  
  <p>DBName.dbo.functionName</p>
  
  <p>How can I view the contents of this function?</p>