SQL using sp_HelpText to view a stored procedure on a linked server
sp_helptext [dbname.spname] try this
Instead of invoking the sp_helptext locally with a remote argument, invoke it remotely with a local argument:
EXEC [ServerName].[DatabaseName].dbo.sp_HelpText 'storedProcName'