Hi @Shivendoo Kumar ,
You could GRANT schema permissions that are effective for everything existing and everything that will exist in that schema.
GRANT SELECT, INSERT, UPDATE, DELETE ON SCHEMA :: <schema> TO <user>;
Further to that, if you want to then deny permissions on a certain object within that schema, you can do.
DENY INSERT ON OBJECT::<schema>.<object> TO <user>;
But in your situation, there is no need for you to deny the permission on that user.
Please refer one example from below:
create database TM1
use TM1
create schema TMS1
create schema TM1App
create table TMS1 .Table1
(ID int,
Name varchar(10))
insert into TMS1 .Table1 values
(1,'Name01'),
(2,'Name02')
SELECT * FROM TMS1 .Table1
CREATE View TMS1.View1
AS
SELECT * FROM TMS1 .Table1
select * from TMS1.View1
CREATE VIEW TM1App.View6
AS
SELECT * FROM TMS1 .View1
select * from TM1App.View6
CREATE LOGIN TM1Login WITH PASSWORD = 'Password123';
create user TM1_User for login TM1Login
GRANT SELECT ON SCHEMA :: TM1App TO TM1_User;
Execute As User='TM1_User'
GO
SELECT * FROM TMS1 .View1
--Msg 229, Level 14, State 5, Line 41
--The SELECT permission was denied on the object 'View1', database 'TM1', schema 'TMS1'.
select * from TM1App.View6
--ID Name
--1 Name01
--2 Name02
Best regards
Melissa
If the answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.