• CELKO (12/15/2010)


    Please post DDL, so that people do not have to guess what the keys, constraints, Declarative Referential Integrity, data types, etc. in your schema are.

    Sample data is also a good idea, along with clear specifications. It is very hard to debug code when you do not let us see it.

    1) Why are you using reserved words, like YEAR and MONTH for data element names?

    4) Why do you have IF-THEN control flow instead of CASE expressions?

    8) "WHERE 1=1" is useless; a SELECT.. FROM statement does not need this.

    For the record, I do agree with Celko on the above statements. Please do post your DDL for better assistance.

    Brandie Tarvin, MCITP Database AdministratorLiveJournal Blog: http://brandietarvin.livejournal.com/[/url]On LinkedIn!, Google+, and Twitter.Freelance Writer: ShadowrunLatchkeys: Nevermore, Latchkeys: The Bootleg War, and Latchkeys: Roscoes in the Night are now available on Nook and Kindle.