Call now: (800) 766-1884  


 SQL Server Tips
 SQL Server Training

 SQL Server Consulting
 SQL Server Support
 SQL Server Remote DBA

 SQL Server Scripts
 Scripts Menu





SQL Server

SQL Server Tips by Gama and Naughter Consulting



These sample XP’s provide for the calculation of the exact occurrences of the solstices and equinoxes each year. Due to the Earth’s inclination in its orbit around the Sun, the point where the Sun appears overhead each day moves from the Southern Hemisphere to the Northern Hemisphere and back again each year. Taking these occurrences in order from when they appear in the year, the Spring or Vernal Equinox is the time when the Sun is directly overhead on the Equator and it is moving from the Southern Hemisphere into the Northern Hemisphere. This event takes place around the 21st of March. The Summer Solstice is when the Sun reaches it maximum northerly latitude and takes place around the 21st of June. The next event is when the Sun reaches the equator again and moves back into the Southern Hemisphere. This event is the Autumnal or Fall Equinox and takes place around 22nd September. The final event in the yearly cycle is the Winter Solstice and this occurs when the Sun reaches its most southerly latitude. This event takes place around the 21st of December.

Each of these XP’s takes an integer value as an input parameter, which is the year to calculate the respective event for. This value is used by the AA+ class framework functions (the public methods in the class “CAAEquinoxesAndSolstices”) to first calculate an approximate value for the event using a simple polynomial series approximation. Then the Sun’s true position is calculated (using the public methods of the class “CAASun”) and an appropriate correction is applied to the approximate value until the size of the correction is less than one second. The returned instant in time is in Dynamical Time, so you may want to use XP_ASTRO_DELTAT to convert it to Universal Time.

The above book excerpt is from:

Super SQL Server Systems
Turbocharge Database Performance with C++ External Procedures

ISBN: 0-9761573-2-2
Joseph Gama, P. J. Naughter





Burleson Consulting Remote DB Administration







Burleson is the America's Team

Note: The pages on this site were created as a support and training reference for use by our staff of DBA consultants.  If you find it confusing, please exit this page.

Errata?  SQL Server technology is changing and we strive to update our SQL Server support information.  If you find an error or have a suggestion for improving our content, we would appreciate your feedback.  Just  e-mail:and include the URL for the page.

Burleson Consulting
SQL Server database support


Copyright © 1996 -  2013 by Vaaltech Web Services. All rights reserved.

Hit Counter