SQL Brain

  • my idea is to create at table with AttributeCategories, Attributes, AttributeValues and AttributeForm.

    Attribute Category my have the information like 'Demographics', 'School Information', 'Contact Information', etc with its Own Unique ID.

    Attribute may have values like AttributeCategoryID with AttributeName, Its Data type (varchar, int) and data length with its Own Unique ID.

    Now you can add as many attributes under each Attribute Category.

    AttributeForm may have its own Unique ID with Form Name.

    The Attributes may be mapped with Each Form to get the values on the against the specific form. This can be done in another table, say FormAttribute.

    Now AttributeValue Table may have ID from table FormAttribute. And Values can be saved in nvarchar format in AttributeValue table.

    Each Attribute will have unique value against each Form.

    You can save any information using above logic. Even Lists and other datatypes can also be included and implemented in this strategy. But it will be too complex to explain in here...

    How about that...?

    Atif Sheikh

    ----------------------------------------------------------------------------------------------------------------------------------------------------------------------
    Sometimes, winning is not an issue but trying.
    You can check my BLOG
    [font="Arial Black"]here[/font][/url][/right]

  • CREATE TABLE #MyHead....

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • Atif Sheikh (8/9/2008)


    my idea is to create at table with AttributeCategories, Attributes, AttributeValues and AttributeForm.

    Attribute Category my have the information like 'Demographics', 'School Information', 'Contact Information', etc with its Own Unique ID.

    Attribute may have values like AttributeCategoryID with AttributeName, Its Data type (varchar, int) and data length with its Own Unique ID.

    Now you can add as many attributes under each Attribute Category.

    AttributeForm may have its own Unique ID with Form Name.

    The Attributes may be mapped with Each Form to get the values on the against the specific form. This can be done in another table, say FormAttribute.

    Now AttributeValue Table may have ID from table FormAttribute. And Values can be saved in nvarchar format in AttributeValue table.

    Each Attribute will have unique value against each Form.

    You can save any information using above logic. Even Lists and other datatypes can also be included and implemented in this strategy. But it will be too complex to explain in here...

    How about that...?

    Atif Sheikh

    please don't tell me the brain uses EAV. if that's true I hope I get reincarnated as a jellyfish.

    ---------------------------------------
    elsasoft.org

  • My dad claims he has infinite-capacity, instantaneous, write-only storage in his brain.

    - Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
    Property of The Thread

    "Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon

  • sure. some call it /dev/null

    or simply a black hole.

    πŸ™‚

    ---------------------------------------
    elsasoft.org

  • I'm afraid mine has no foreign key constraints. Helps with creativity and problem solving and spews out some hillarious "stream-of-consiousness" conversations. Well, at least I think they're hillarious, and that's what matters, right? πŸ˜›

    I'll be back after I finish running DBCC CHECKBRAIN

    Chad

  • Chad Crawford (8/15/2008)


    I'll be back after I finish running DBCC CHECKBRAIN

    Chad

    This one runs nightly, sometimes with irritating sound effects.

    β€œWrite the query the simplest way. If through testing it becomes clear that the performance is inadequate, consider alternative query forms.” - Gail Shaw

    For fast, accurate and documented assistance in answering your questions, please read this article.
    Understanding and using APPLY, (I) and (II) Paul White
    Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden

Viewing 7 posts - 16 through 21 (of 21 total)

You must be logged in to reply to this topic. Login to reply