Click or drag to resize
sqx

SQXNTable Method

Function [table] NTable([int] StartValue, [int] EndValue)

Namespace:  sqx
Assembly:  SQX (in SQX.dll) Version: 1.0.2.6 (1.0.2.6)
Syntax
C#
public static IEnumerator NTable(
	SqlInt32 StartValue,
	SqlInt32 EndValue
)

Parameters

StartValue
Type: System.Data.SqlTypesSqlInt32
[int]
EndValue
Type: System.Data.SqlTypesSqlInt32
[int]

Return Value

Type: IEnumerator
[table]
Remarks
Generate table with int values starting at StartValue and ending at EndValue [int].

NOTE: NTable is asynchronous, when sequential numbers are needed use ORDER BY clause.

Attributes

IsDeterministic = true, IsPrecise = true, DataAccess = DataAccessKind.None, SystemDataAccess = SystemDataAccessKind.None, TableDefinition = "Value int"
Examples
SQL
SELECT * FROM sqx.NTable(0, 5)
/*
Value
-----------
0
1
2
3
4
5*/

SELECT * FROM sqx.NTable(5, 0)
/*
Value
-----------
5
4
3
2
1
0*/
SQL
DECLARE @X float = 2.5
SELECT SUM(POWER(@X, Value) / sqx.Factorial(Value))
FROM sqx.NTable(0, 170)
/*
----------------------
12.1824939607035*/

SELECT EXP(sqx.LOGADDSUM(Value * LOG(@X) - sqx.LogFactorial(Value)))
FROM sqx.NTable(0, 170)
/*
----------------------
12.1824939607035*/
SQL
DECLARE @X float = 20.5, @N int = 85
SELECT sqx.PRODUCT(POWER(@X, Value) / sqx.Factorial(Value))
FROM sqx.NTable(0, @N)
/*
----------------------
4.24518065817538E+15*/

SELECT EXP(SUM(Value * LOG(@X) - sqx.LogFactorial(Value)))
FROM sqx.NTable(0, @N)
/*
----------------------
4.24518065817538E+15*/
See Also