get the list of all encrypted columns in db

  • Hi,

    Is there any script to find all tables encrypted columns in database

    Thanks!

  • I'm not an expert on the encryption in SQL Server, but from looking at the BOL article on column encryption, there's no such thing.

    It's simply a varbinary column that you apply an encryption function to when you store the results, so it isn't defined as encrypted.

    You can easily find all varbinary columns in your database with something like:

    SELECT stab.name Table_Name, sc.name Column_Name FROM sys.columns sc

    INNER JOIN sys.types st ON sc.system_type_id=st.system_type_id

    INNER JOIN sys.tables stab ON stab.object_id=sc.object_id

    WHERE st.name='varbinary'

    AND stab.is_ms_shipped=0

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply