I execute an alter on function in Sql Server. Is it possible to rollback this change? And what is the syntax? The commands aren't transactional.
Asked
Active
Viewed 152 times
0
-
possible duplicate of [Are schema modifying commands transactional?](http://stackoverflow.com/questions/2133781/are-schema-modifying-commands-transactional) – GSerg Apr 21 '15 at 08:04
-
possible duplicate of [Can I change table structure in a transaction and then roll it back if there is an error?](http://dba.stackexchange.com/q/24883/5203) – GSerg Apr 21 '15 at 08:07
-
@GSerg Although the question states "rollback" if you read it carefully you'll understand that the question has nothing to do with transactions and the `ROLLBACK` command. So, this is nod a duplicate. – JotaBe Apr 21 '15 at 08:09
-
1@JotaBe That might be, but I'm not convinced because it may be the other way too. Please clarify in your answer that you are talking about rolling back after a commit. Rolling back from inside of a transaction certainly works for `alter function`. I also find your title edit questionable - now it does look like you understood it, but it might not be what the OP meant. – GSerg Apr 21 '15 at 08:12
-
@Sara always use Version store for your objects Like SVN or TFS so that you can maintain your history for all of the objects .rollback is not a good approach for this . – Arun Gairola Apr 21 '15 at 11:14
-
Thanks @ArunGairola ! This is a very good idea! We'll do that! – Sara Apr 22 '15 at 06:37
1 Answers
0
No that's not possible.
Your only hope is that you have a backup with the previous version of the function to see how it looked like before you changed it. If you don't have backups, you're out of luck.

JotaBe
- 38,030
- 8
- 98
- 117