• In addition to implementing views as a means of rrestricting user access to columns and rows, I've also used them as a wrapper for tables that contain symmetric key encrypted columns, having computed columns perform all the tedious function calls. In the example below, all the application has to do is properly open the symmetric key, and then it can select from the view, returning data unencrypted and re-cast as needed. Before writing views to do this, I was getting way too many questions from developers and analysts about how to decrypt columns. Now it's transparent.

    create view ABC.vMembership

    as

    select

    Patient_ID,

    Group_Nbr,

    Begin_Date,

    Term_Date,

    cast(DecryptByKey(First_Name) as varchar(30))First_Name,

    cast(DecryptByKey(Birth_Date) as datetime)Birth_Date,

    cast(DecryptByKey(Subscriber_ID) as varchar(30))Subscriber_ID,

    cast(DecryptByKey(Phone_Nbr) as varchar(30))Phone_Nbr

    from ABC.Membership;

    "Do not seek to follow in the footsteps of the wise. Instead, seek what they sought." - Matsuo Basho