Changing the syb_syscommkey

To change the syb_syscommkey, create a new key and use sp_hidetext to reencrypt with the new key.

For example:
  • Example 1 – Create a new hidden text encryption key and encrypt all SQL text objects in the syscomments table with the newly created key:
    create encryption key syb_syscommkey
    go
    sp_hidetext
    go
    Note: When a new syb_syscommkey is created, it becomes the default key used by sp_hidetext in that database.
  • Example 2 – Create a new hidden text encryption key, encrypt the text of a specific stored procedure in syscomments with the newly created key, and protect the key with the master key:
    create encryption key syb_syscommkey
           with master_key
    go
    sp_hidetext sp_mysproc
    go

    In this example, all other hidden text rows in syscomments remain encrypted with the previous encryption key.