We have modified one of our stored procedures code and accidentally committed it in production DB also. Now we need the older version of the code. Is there any way to get the old version of a stored procedure from the DB? We didn't take any backup of the code. Please help.
Sql-server – Get the old version of stored procedure code in sql server
sql servert-sql
Related Question
- SQL Server – Using sp_addrolemember in Stored Procedure for Different Database
- Sql-server – Converting old SQL Server outer join syntax
- SQL Server 2014 – Analyzing Multiple Stored Procedure Statistics
- SQL Server – Get Stored Procedure Result Column Types
- Sql-server – SQL server security
- Sql-server – T-SQL Stored Procedure Returns Before Completing
- SQL Server: Execute Stored Procedure Inside Another from Linked Server
Best Answer
To answer you directly.
You cannot get back the old version of the sp , if it is already executed in production, unless you have a backup or you have a customize trigger that logs all execution of sp.
This happens to my team before, that's why we created a trigger that logs all execution. or you can use SQL source control.
The only thing that you can do now is data fix in production.