Click here to Skip to main content
15,868,016 members
Articles / Programming Languages / SQL
Alternative
Tip/Trick

The Evil That is "Select *"

Rate me:
Please Sign up or sign in to vote.
5.00/5 (2 votes)
2 Aug 2011CPOL 6.8K   1
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)


Written By
United States United States
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions

 
GeneralWhat are you in when you're able to highlight that query and... Pin
Member 77966779-Aug-11 4:32
Member 77966779-Aug-11 4:32 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.