Using * in SQL VIEW definitions

Do not use * in column list of SQL VIEW definitions!

CREATE VIEW bad_view
SELECT * FROM some_table

SQL Server will introduce some problems when the underlying table structure changes.
If for example You insert some columns between pre-existing ones into some_table above
the view result will be shifted and result columns appear below bad column headers!
This may occure without any sign of error!

Read more:

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.