What is Right and/or Wrong with SELECT *
Posted on 2006-06-06
I have been around a couple of blocks with SQL Server. But one direction I am not clear about is whether or not to use SELECT * in my views and stored procedures.
For maintenance purposes, it seems to me that using SELECT * relieves the maintenance person of having to modify a lot of stored procedure and view scripts. All they have to do is run sp_refreshview and sp_recompile as appropriate after altering a table.
Generally, you are altering a table to add columns, and if you always add columns to the end of a table, then even forgetting to run sp_refreshview and sp_recompile will not cause regression errors (the new fields will not be there but the old ones will still be referenced correctly.
So, why else would SELECT * be "evil?