Click here to Skip to main content
65,938 articles
CodeProject is changing. Read more.
Articles / Languages / SQL

The Evil That is Select *

5.00/5 (2 votes)
2 Aug 2011CPOL 7.2K  
I agree with this. However, typing all of the columns can be tedious! Now imagine you are working with a table with DOZENS of columns?! SELECT * FROM DENORMALIZEDTABLE1If you are using MS-SQL or writing a query in MS Visual Studio then there is a trick. You can: * write the select *...
I agree with this. However, typing all of the columns can be tedious! Now imagine you are working with a table with DOZENS of columns?!
SQL
SELECT * FROM DENORMALIZEDTABLE1


If you are using MS-SQL or writing a query in MS Visual Studio then there is a trick. You can:
* write the select * like above
* hilight the query
* right click
* and select "Design query in editor.."
* Click Ok to close the query editor

Poof! The SELECT * has been replaced with explicit column names! No excuses!

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)