I have several stored procedures in my database, structured as follows:
CREATE PROCEDURE MyProcedure (.....) AS DECLARE @myvar NVARCHAR(100); SET @myvar = (SELECT .... FROM my_table WHERE ....) GO
I was asked to replace the my_table in the FROM different one in every procedure that has it.
I went through a lot of research, but I have to create a script that works on its own, and I did not find anything suitable. For example, I found sp_helpTetx , which shows the source code of a stored procedure, but is there a way to put it in a variable to edit it?
sql-server tsql stored-procedures
Phate01
source share