• CELKO (1/4/2013)


    What specifically should requester do then?

    As I said, read books on basic Software Engineering. Yourdon and Constantine's STRUCTURED DESIGN is still classic. Chapters 6 and 7 are on Coupling and Cohesion. But you can find almost any book that will cover these fundamentals.

    What specifically then should one do when a table has, say, 50 columns that can be arbitrarily filtered by users in self-directed queries, and you have to provide the supporting code?

    Post DDL, sample data and clear specs. He did none of this. The problem is that he has no foundations. It is impossible to give him the education in a forum. The short answer is that you do not write code that allows a random stranger arbitrary access to data at run time. You need to have specs.

    Let me ask:

    1) Why do want to write a declarative language like SQL with procedural flow control? Do you like cursors? Loops? Recursive CTEs, which are both?

    2) Why are bit flags, loose cohesion and tight coupling a good way to program?

    3) Why would you have a design so bad that you need dynamic SQL? Are data element names changing at run time? Is the name of the procedure “No_Idea_What_I_Am Doing_Until_Run Time”? Or (more likely) are you doing display formatting the database layer and not the presentation layer?

    There's no "random stranger". That's just an idiotic, pointless slur.

    We're giving "power employees" of the company access to the company's data to derive business benefit.

    If you're incapable of really assisting with that in a real-world situation, just say so. Don't hide behind idiotic and irrelevant prattle.

    SQL DBA,SQL Server MVP(07, 08, 09) A socialist is someone who will give you the shirt off *someone else's* back.