View Single Post
chucker
 
Join Date: May 2004
Location: near Bremen, Germany
Send a message via ICQ to chucker Send a message via AIM to chucker Send a message via MSN to chucker Send a message via Yahoo to chucker Send a message via Skype™ to chucker 
2010-08-23, 13:41

Quote:
Originally Posted by BenP View Post
This seems like a bad idea to me because of security, performance, and debugging issues, but my boss is pretty insistent.

Is it actually a bad idea?
Yes. You can't do parametrization that way, which means, among other things:
  1. you're opening the flood gates for SQL injection potential
  2. the RDBMS can't optimize your queries should they repeat again, because the objects (e.g. columns) are entirely arbitrary, so no indexing and statistics are possible

Needless to say, you're throwing most benefits of a relational database out the window. Might consider a dictionary-based alternative, in that case.

There are reasons to do this, but a catch-all "update x set y=z" procedure sounds absolutely horrid.
  quote