• Well what you designed is too good. What i created is part of script and to practice it with datetime function with minimum loops included.

    While browsing your article i found something which i would like to share with you. I am not much good with sql but all these are my queries:

    1) you come up new fashioned query to add large amount of data in table. but what about memory size it will occupy? I have worked on calendar module developed in asp.net, havent seen like created calendar table with all dates in database. If you consider real case scenario this isnt possible.

    2) Use of cursor is never been a good idea. cursor includes lot of overhead to query. if you can use if else or for loop just avois cursor.

    3) with use of small functions, you can implement all features. you can use table variable instead.

    4) what i have learnt is datetime things should never be compared like this: dt >= '20040401' AND dt < '20040501'. This is not efficient way of coding.

    I hope you understand my point of view.

    Thanks,

    Ashka Modi
    Software Engineer || credEcard Technologies (india) Pvt. Ltd.