Recover database encrypted modules code with dbatools


SQL Server offers an option to encrypt the code of your modules when using the ‘WITH ENCRYPTION’ syntax. This allows to hide/obfuscate the modules’ code and thus keep away from prying eyes. It’s often used to protect business rules since it allows you to protect some intellectual property. In this article, we will look at how to recover the code from encrypted modules.

What is a module in SQL Server?

In the SQL Server world, a module consists of a block(s) of T-SQL statements that make up a stored procedure, a function, a trigger or a view definition.

Which modules