Have seen existing scripts to work out number of days in month. They tend to work out the month, and then whether it's a leap year.
Another approach is to take the date passed in, find the first day of the next month, and then use Datadd to take off one day, ie: last day of required month. Then Datepart to get the day number. Since it uses the servers datetime system, there is no need to worry about leap years as it will sort that out for you:
A Normalization Primer
For most DBAs, normalization is an understood concept, a bread and butter bit of knowledge. However, it is not at all unusual to review a database design by a development group for an OLTP (OnLine Transaction Processing) environment and find that the schema chosen is anything but properly normalized. This article by Brian Kelley will give you the core knowledge to data model.
2003-01-13
18,594 reads