Hi experts, I have a scenario in which i had executed getting the list of all stored procedures in a database. Now with this as input i need to get the scripts of all these stored procedures as output Here is the query for which i have got the list of all stored procedures.
select 'exec'+' '+'sp_helptext'+ ' ' + name from sys.all_objects where type = 'P' and object_id > 0
How do i get the scripts of these procedures using the same query as input?
I dont need to create any tables actually. I should execute it with a single query of getting the scripts of all stored procedures with the stored procedures names as input and extract the scripts from it as output