Sebastiao Pereira approximates an integral in T-SQL:
The Newton-Cotes formulas are a useful and straightforward family of numerical integration, which is the approximate computation of an integral using numerical techniques. The numerical computation of an integral is also called quadrature. How can we build these formulas in SQL Server without using external tools?
Click through to see how it all works.