they said select star was bad but
TRANSCRIPT
Gordon Beeming
twiiter.com/GordonBeemingfacebook.com/BinaryDigit.0110za.linkedin.com/in/b1n4ryd1g1tbinary-stuff.comgordon-beeming
They said Select * was bad but...
http://r3f.co/1JWf5XM
Setup• Database• Table• View• Some Data
Add a column C
A little while later…
Check our data
Start fresh• Drop/Create the table• Add the extra column• Drop/Create the view• Populate with some data
It works!
But how?
Break it again• Drop/Create the table• Drop/Create the view• Add the extra column• Populate with some data
Alter view
Rewind a bit
Compare Information Schema
Rename a column
Check results and Information Schema
Check sys.views and sys.columns
Refresh view and recheck metadata tables
Drop column, Add column
Check metadata tables again
Refresh view and select again
Get new data
Drop column, Add Column, Rename Column
Check the metadata tables
Refresh view
Drop Column Only
Moment of truth
Refresh for the last time
Our last cleanup
What if I didn’t use Select *?
Add column
Alter view
SQL would do what I expect it to do
Fix it
Gordon Beeming
twiiter.com/GordonBeeming
facebook.com/BinaryDigit.0110
za.linkedin.com/in/b1n4ryd1g1tbinary-stuff.com
gordon-beeming
/* END */