SqlCommandColumnEncryptionSetting 列舉


指定讀取及寫入加密的資料行時,資料的傳送及接收方式。 根據您的特定查詢,當使用非加密的資料行時,略過 Always Encrypted 驅動程式的處理可能會降低對效能的影響。 請注意,這些設定不能用來略過加密並存取純文字資料。 如需詳細資訊,請參閱 Always Encrypted (資料庫引擎)For details, see Always Encrypted (Database Engine).

public enum class SqlCommandColumnEncryptionSetting
public enum SqlCommandColumnEncryptionSetting
type SqlCommandColumnEncryptionSetting = 
Public Enum SqlCommandColumnEncryptionSetting


Disabled 3

停用查詢的 Always Encrypted。Disables Always Encrypted for the query.

Enabled 1

啟用查詢的 Always Encrypted。Enables Always Encrypted for the query.

ResultSetOnly 2

指定驅動程式中的 Always Encrypted 常式只應處理命令的結果。Specifies that only the results of the command should be processed by the Always Encrypted routine in the driver. 當命令沒有需要加密的參數時,請使用這個值。Use this value when the command has no parameters that require encryption.

UseConnectionSetting 0

指定命令應該預設為連接字串中的 Always Encrypted 設定。Specifies that the command should default to the Always Encrypted setting in the connection string.


  • 如果已停用查詢的 Always Encrypted, 且查詢具有需要加密的參數 (對應至加密資料行的參數), 則查詢將會失敗。If Always Encrypted is disabled for a query and the query has parameters that need to be encrypted (parameters that correspond to encrypted columns), the query will fail.

  • 如果已針對查詢停用 Always Encrypted, 且查詢傳回來自加密資料行的結果, 則查詢會傳回加密值。If Always Encrypted is disabled for a query and the query returns results from encrypted columns, the query will return encrypted values. 加密的值將會有 Varbinary 資料類型。The encrypted values will have the varbinary datatype.