Create login harsha WITH PASSWORD = 'Passwordplz'; GO Create USER harsha FOR LOGIN harsha; GO EXEC sp_addrolemember 'db_ddladmin', 'harsha'; GO
declare @n char(1) set @n = char(10) declare @tables nvarchar(max)
select @tables = CAST('' as nVarChar(MAX))+ isnull( @tables + @n, '' ) + 'DENY VIEW DEFINITION ON [' + schema_name(schema_id) + '].[' + name + '] TO [harsha];' from sys.tables order by name desc
exec sp_Executesql @tables GO
GRANT VIEW DEFINITION ON [dbo].[table0] TO [harsha];
Don't forget to subscribe to our channel. https://www.youtube.com/tricksthatmakesmart https://www.facebook.com/tricksthatmakeyousmart https://www.facebook.com/groups/tricksthatmakeyousmart