|
|
|
SSC-Addicted
      
Group: General Forum Members
Last Login: Friday, June 15, 2012 7:53 PM
Points: 494,
Visits: 299
|
|
Comments posted to this topic are about the item Preventing usage of "SELECT *..."
The vision must be followed by the venture. It is not enough to stare up the steps - we must step up the stairs. - Vance Havner
|
|
|
|
|
SSCrazy
      
Group: General Forum Members
Last Login: Wednesday, April 24, 2013 5:02 AM
Points: 2,365,
Visits: 1,825
|
|
Interesting but i feel its not practical to add dummy columns to tables.
"Keep Trying"
|
|
|
|
|
Forum Newbie
      
Group: General Forum Members
Last Login: Thursday, November 05, 2009 3:53 AM
Points: 1,
Visits: 0
|
|
| Another solution that works well in most situations is to simply avoid allowing users to execute SQL statements at all - ensure that all access to tables is performed via stored procedures.
|
|
|
|
|
Forum Newbie
      
Group: General Forum Members
Last Login: Friday, April 09, 2010 8:36 AM
Points: 2,
Visits: 23
|
|
We have similiar issues here with the use of *, espically with young developers.
As all our DB projects are under source control, ive been able to control checking in SQL containing * using Code Analysis and Check in policies.
Regards
Gary Howlett www.garyhowlett.co.uk
|
|
|
|
|
Old Hand
      
Group: General Forum Members
Last Login: Wednesday, February 13, 2013 12:30 AM
Points: 353,
Visits: 487
|
|
|
|
|
|
SSC Eights!
      
Group: General Forum Members
Last Login: Today @ 10:31 AM
Points: 836,
Visits: 2,192
|
|
In interesting solution, for a not so real problem, as any decent organisation has standards in place and will ensure that all code conforms to the corporate standards.
If not the developer resonsible needs to rewrite the code in line with the standards, they eventually learn that they cant write Selcet * as they have to do double the work.
Besides with the 2008 GDR, you can enforce these at a code entry level.
_________________________________________________________________________ SSC Guide to Posting and Best Practices
|
|
|
|
|
Forum Newbie
      
Group: General Forum Members
Last Login: Thursday, March 17, 2011 4:53 AM
Points: 4,
Visits: 51
|
|
I think you can still use 'select anyfield, tblname.* from tblname' though.
|
|
|
|
|
Ten Centuries
      
Group: General Forum Members
Last Login: Today @ 4:05 AM
Points: 1,127,
Visits: 937
|
|
| I love posts like this. Sure, the specific example used may not be practical, but I just like the thinking behind coming up with the solution. Often that in itself can open up other avenues of thought that would otherwise have remained hidden.
|
|
|
|
|
SSC Rookie
      
Group: General Forum Members
Last Login: Tuesday, June 07, 2011 8:13 AM
Points: 42,
Visits: 54
|
|
May not be practical. May not be standard.
But it is a good/smart solution.

Regards.
Fernando Ponte factdata.com.br
|
|
|
|
|
Forum Newbie
      
Group: General Forum Members
Last Login: Thursday, March 17, 2011 4:53 AM
Points: 4,
Visits: 51
|
|
But it does not solve the problem when I can use
select tblname.* from tblname
with the same result.
|
|
|
|