Right-click your connection, choose Properties and check Include System Views and SPs. You'll then notice a sys database in the schema, containing the system views and SPs, and the following will work:
sys.sp_helptext ("mySchema.usp_myProc")
Question
I'm trying the 'LinqPad Challenge' but I've come up with a usage scenario that has stumped me.
For a given database, I am able to successfully query the 'sp_helptext' sproc using SQL as the language
-- SQL
sp_helptext '[mySchema].[usp_myProc]'
however the sp_helptext sproc does not seem to have generated a corresponding method in my Linq2Sql context, and as such I can't query this function using C#.
// C#
sp_helptext("[mySchema].[usp_myProc]")
is there some other way to access the sp_helptext function using C# as the language for my query.
La solution
Right-click your connection, choose Properties and check Include System Views and SPs. You'll then notice a sys database in the schema, containing the system views and SPs, and the following will work:
sys.sp_helptext ("mySchema.usp_myProc")