I had a Table-Valued Function in SQL Server and someone from my colleagues has altered it unexpectedly. How can I restore previous version easily? Is there any way to find the previous version?
Sql-server – Finding changes for table-valued function definition on SQL Server
sql serversql-server-2008
Related Question
- SQL Server – Table Valued Function vs Stored Procedure
- Most Efficient Way to Call Same Table-Valued Function on Multiple Columns in SQL Server
- SQL Server – Forced Serialization on Inline Table Valued Function
- Sql-server – SQL Server: Pass table name into table valued function as a parameter
- Sql-server – Optimizing table valued function SQL Server
- Sql-server – Inline function Plan Properties in SQL Server 2008
Best Answer
The answer is unfortunately no. Without some form of source control or a functional back-up to go to you are kind of out of luck. As soon as you push execute on that alter statement you have changed that table/function/view/StoredProc. For future precautions you should probably have nightly back-ups make sure only the appropriate people have the user permissions required to make database changes. Also you want to make sure you have source control and are following a proper procedure for testing and deployment to make sure this does not happen in the future.