Implementing Row Level Security on SQL Server

Поделиться
HTML-код
  • Опубликовано: 8 сен 2024
  • Implementing row level security become very important if you are using SQL Server as warehouse or implementing multi tenancy.

Комментарии • 5

  • @pvksmaheeth8816
    @pvksmaheeth8816 6 месяцев назад

    is there an option in SQL server, that the whole table data is encrypted and to view the original data I need two passwords, one for myself and the other for the client

  • @pvksmaheeth8816
    @pvksmaheeth8816 6 месяцев назад

    can we call this table level security ?

  • @juancarlostorresmachuca8984
    @juancarlostorresmachuca8984 10 месяцев назад

    This is so helpful, is there any way to have your script?

    • @techsapphire
      @techsapphire  10 месяцев назад

      /****** Script for SelectTopNRows command from SSMS ******/
      SELECT *
      FROM [dbo].[]
      create schema Security
      CREATE FUNCTION Security.tvf_(@filtercolumn AS nvarchar(50))
      RETURNS TABLE
      WITH SCHEMABINDING
      AS
      RETURN SELECT 1 AS tvf_securitypredicate_result
      WHERE @filtercolumn = USER_NAME();
      GO
      CREATE SECURITY POLICY Filter
      ADD FILTER PREDICATE Security.tvf_Predicate(filtercolumn)
      ON dbo.[]
      WITH (STATE = ON);
      GRANT SELECT ON schema::dbo TO [];
      GRANT SELECT ON schema::dbo TO SalesRep1;
      CREATE LOGIN [] WITH PASSWORD=N'MX%e[bz4+Ld],r]X' ,DEFAULT_DATABASE=[IbAssetsAndReferencesDev]
      CREATE USER [] FOR LOGIN []

    • @sohailakbar7577
      @sohailakbar7577 4 месяца назад

      @@techsapphire Good question and good reply. Thanks