Click here to Skip to main content
Click here to Skip to main content
Alternative Tip/Trick

Tagged as

The Evil That is "Select *"

, 25 Jul 2011 CPOL
Rate this:
Please Sign up or sign in to vote.
I 100% agree with this.Another trick is *if possible* add audit columns at the time of creating/designing the database, i.e.:CreatedOnCreatedByLastModifiedOnLastModifiedByThis could prevent people from using Select *, because generally we don't display such information anywhere, and...

I 100% agree with this.

Another trick is *if possible* add audit columns at the time of creating/designing the database, i.e.:

CreatedOn
CreatedBy
LastModifiedOn
LastModifiedBy

This could prevent people from using Select *, because generally we don't display such information anywhere, and also it will be useful someday to find/fix issues (or atleast you can point a finger at someone).

And for the lazy people, if you want a list of columns from a table with a lot of columns, use SQL Server Management Studio and right click on the table from Object Explorer, and "Select Top 1000 Rows", which will give you the proper Select * From table statement. Modify it and use it.

License

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

Share

About the Author

Rutvik Dave
Founder Centramation Systems Pvt. Ltd.
India India
No Biography provided
Follow on   Twitter

Comments and Discussions

 
-- There are no messages in this forum --
| Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.141220.1 | Last Updated 25 Jul 2011
Article Copyright 2011 by Rutvik Dave
Everything else Copyright © CodeProject, 1999-2014
Layout: fixed | fluid