On 5/28/2012 9:13 PM, Ken Dibble wrote: > >> Views are to set in place the obnoxious code you don't want to retype >> like below: >> >> >> SELECT CONVERT(datetime, MAX(CASE QAVariable WHEN 'DATE:D' THEN >> DataValue END)) AS [DATE:D], CONVERT(datetime, >> MAX(CASE QAVariable WHEN 'TIME:T' THEN DataValue >> END)) AS [TIME:T], CONVERT(nvarchar(250), MAX(CASE QAVariable WHEN >> 'LOCATION:A' THEN DataValue END)) >> AS [LOCATION:A], CONVERT(nvarchar(250), >> MAX(CASE QAVariable WHEN 'PLANT_NO:A' THEN DataValue END)) AS >> [PLANT_NO:A], CONVERT(nvarchar(250), >> MAX(CASE QAVariable WHEN 'LOT_CODE:A' THEN > > [snipped something like 300 lines of insanely repetitve code] > > This is a joke, right, Stephen? Tell me this is not state of the art > database code in 2012? Are we really sure dynamic SQL wouldn't be better > than this??? >
Thanks, Ken. I, too, thought that was some pretty f*cked up sh!t. -- Mike Babcock, MCP MB Software Solutions, LLC President, Chief Software Architect http://mbsoftwaresolutions.com http://fabmate.com http://twitter.com/mbabcock16 _______________________________________________ Post Messages to: [email protected] Subscription Maintenance: http://leafe.com/mailman/listinfo/profox OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech Searchable Archive: http://leafe.com/archives/search/profox This message: http://leafe.com/archives/byMID/profox/[email protected] ** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.

