YTUnity logo

Welcome to YTUnity

One free SpiderTaz Network account works across every network site.

Getting schema information for the database failed with the exception."500 is the max"

Tricks That Make you Smart Video 6 years ago

Description

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

Featured creators

Creators on the SpiderTaz Network

Become a creator →