Stop People From Changing Tables with This One Trick
I received today's posts from Brent Ozar, I feel it is very interesting, LOL:
Brent Ozar says:
Stop People From Changing Tables with This One Trick
Brace yourselves. Our Black Friday sale is coming.
Developers hate his bad idea jeans:
CREATE VIEW dbo.StopThemDead WITH SCHEMABINDING
AS
SELECT COUNT(*) FROM dbo.Table1
UNION ALL
SELECT COUNT(*) FROM dbo.Table2
UNION ALL....
Presto, the schemabinding option means no one can change the underlying tables. (At least, until they figure out about your view.)
Obligatory disclaimer: seriously, this is a really bad idea. But it’s hilarious.
Brent Ozar says:
Stop People From Changing Tables with This One Trick
Brace yourselves. Our Black Friday sale is coming.
Developers hate his bad idea jeans:
CREATE VIEW dbo.StopThemDead WITH SCHEMABINDING
AS
SELECT COUNT(*) FROM dbo.Table1
UNION ALL
SELECT COUNT(*) FROM dbo.Table2
UNION ALL....
Presto, the schemabinding option means no one can change the underlying tables. (At least, until they figure out about your view.)
Obligatory disclaimer: seriously, this is a really bad idea. But it’s hilarious.
Comments
Post a Comment