devxlogo

View the Source Code of Stored Procedures in Yukon

View the Source Code of Stored Procedures in Yukon

In SQL Server 2000, you would simply use sp_helptext to view the source code of both user-defined and system-stored procedures. But that isn’t completely true in Yukon.

To view the source code of a user-defined stored procedure in Yukon, use the following code snippet:

sys.sp_helptext ProcedureName

Or you could also use the following:

sp_helptext ProcedureName

In SQL Server 2000, you’d use the following syntax to view the source code of system-stored procedures:

use mastersp_helptext sp_help

However, sp_helptext cannot be used to display the definition of system objects in Yukon. So, for system stored procedures use the following syntax:

Select object_definition (object_id ('sys.sp_helptext')) as 'Source of Sp_helptext'
See also  Professionalism Starts in Your Inbox: Keys to Presenting Your Best Self in Email
devxblackblue

About Our Editorial Process

At DevX, we’re dedicated to tech entrepreneurship. Our team closely follows industry shifts, new products, AI breakthroughs, technology trends, and funding announcements. Articles undergo thorough editing to ensure accuracy and clarity, reflecting DevX’s style and supporting entrepreneurs in the tech sphere.

See our full editorial policy.

About Our Journalist