Is there anything wrong with storing SELECT statements in a table.

Posted on 2011-10-25
Last Modified: 2012-05-12
Is there anything wrong with storing SELECT statements in a table.

Like the question asked on
Question by:Mr_Shaw
    LVL 57

    Assisted Solution

    by:Raja Jegan R
    It depends upon the scenario..
    If you want to create your SELECT statements dynamically based on several parameters, then you can store the base SELECT query in the table and then add WHERE clauses and ORDER BY clauses dynamically..

    Author Comment

    The C# devs who I work with joked about the table.....but I can't see anything really bad about it.
    LVL 57

    Accepted Solution

    Yes, if there is no necessity to dynamically form queries, then there is no need for that table.
    But if you need to dynamically form queries which should be much customizable, then you can have a table like that..

    Author Closing Comment


    Featured Post

    Do You Know the 4 Main Threat Actor Types?

    Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

    Join & Write a Comment

    Suggested Solutions

    Title # Comments Views Activity
    query question 4 21
    SQL Job Error in SSIS Package 2 43
    SSD vs SAS disk for SQL 9 37
    SQL Server 2008 backup issue 3 13
    SQL Server engine let you use a Windows account or a SQL Server account to connect to a SQL Server instance. This can be configured immediatly during the SQL Server installation or after in the Server Authentication section in the Server properties …
    In this article I will describe the Backup & Restore method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
    Via a live example, show how to setup several different housekeeping processes for a SQL Server.
    Viewers will learn how to use the SELECT statement in SQL to return specific rows and columns, with various degrees of sorting and limits in place.

    745 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    15 Experts available now in Live!

    Get 1:1 Help Now