• kapil_kk (10/22/2012)


    how can we restricted a view to a particular user only?

    you can do that either by checking the suser_name(), or comparing it agasint a table of permissions you create.

    a basic examples:

    SELECT

    'ColumnList',

    OBJECT_ID,

    CASE

    WHEN suser_name() IN( 'disney\lizaguirre','ClarkKent','Bob' )

    THEN ''

    ELSE name

    END As name from sys.columns

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!