Alternatives
Members may post updates or alternatives to this current article in order to show different
approaches or add new features.
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 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'm using this way. SELECT * FROM VIEW. Consider the below Table has following fields(Including Non-display columns).Table...
25 Jul 2011Ennis Ray Lynch, Jr.
As a counter, relative indexing from SELECT * queries is most often the cause of the "evil". Although we live in a day and age of autogenerated DAL's, using the data reader's indexor that accepts a string is a valid and acceptable alternative to the never use a SELECT * query, in fact, when...
Another 'weird feature' of select * is that in Views select * does not select all columns from a table. It selects all columns from a table that were in the table at the time that the View was created. I found that out when I added some columns to a table and wanted to map those columns in a...
It also limits SQL's ability to find a proper index to use, hence hindering performance. I wasn't aware of this aspect until a SQL consultant made mention of it. Unfortunately we haven't adopted the policy of dropping the *.
I've been paid as a programmer since 1982 with experience in Pascal, and C++ (both self-taught), and began writing Windows programs in 1991 using Visual C++ and MFC. In the 2nd half of 2007, I started writing C# Windows Forms and ASP.Net applications, and have since done WPF, Silverlight, WCF, web services, and Windows services.
My weakest point is that my moments of clarity are too brief to hold a meaningful conversation that requires more than 30 seconds to complete. Thankfully, grunts of agreement are all that is required to conduct most discussions without committing to any particular belief system.