0

我有一个数据库,其中包含一些我想导出的加密视图,但我必须将加密从 true 更改为 false。下面的代码显示了加密的对象,我想知道是否可以通过对代码进行简单修改来将加密从 true 更改为 false。

USE Tfs_Database
GO
SELECT name, object_id, type_desc
FROM sys.objects 
WHERE OBJECTPROPERTY(object_id, N'IsEncrypted') = 1
ORDER BY type_desc, name;
GO

我需要这个才能使用自动生成脚本功能。

4

1 回答 1

2

You can't change system tables. And what would be the point? You would change that bit column to 0 but the object is still encrypted. So what use would you have for the unintelligible scripts you would produce?

The right way to script encrypted objects is to pull them from source control. After all, if you're encrypting objects, you'd better have them in source control.

If you can't do that, then search around the web for a function to decrypt stored procedures. It's not exactly NSA material.

于 2012-06-26T17:00:59.183 回答