Bad Idea Jeans

Brent’s Bad Idea Jeans: Stop People From Changing Tables with This One Trick

Bad Idea Jeans, Humor, SQL Server
21 Comments
Developers hate his bad idea jeans: Transact-SQL CREATE VIEW dbo.StopThemDead WITH SCHEMABINDING AS SELECT COUNT(*) FROM dbo.Table1 UNION ALL SELECT COUNT(*) FROM dbo.Table2 UNION ALL.... 123456 CREATE VIEW dbo.StopThemDead WITH SCHEMABINDINGASSELECT COUNT(*) FROM dbo.Table1UNION ALLSELECT COUNT(*) FROM dbo.Table2UNION ALL.... Presto, the schemabinding option means no one can change the underlying tables. (At least, until they…
Read More

Brent’s Bad Idea Jeans [Video]

Bad Idea Jeans, Humor, SQL Server
9 Comments
Over the years, I’ve come up with some rather “interesting” answers to SQL Server problems including: Warming up SQL Server’s buffer pool by selecting all the data from all the tables Creating indexes with triggers Adding nonclustered indexes to clustered columnstore indexes Compressing backups the hard way Putting databases on a RAM drive In this 20-minute…
Read More

How to Add Nonclustered Indexes to Clustered Columnstore Indexes

SQL Server 2012 introduced nonclustered columnstore indexes, but I never saw them used in the wild simply because once created, they made the underlying table read-only. Not a lot of folks like read-only tables. (Bad news, by the way – that limitation hasn’t disappeared in 2014.) SQL Server 2014 brings clustered columnstore indexes, and they’re…
Read More