System

System Functions

Function Name

.NET Framework Method

Example

ISNULL

None

SELECT AVG(ISNULL(price, 10.00)) FROM titles

DATEADD

Microsoft.VisualBasic.DateAdd

SELECT millisecond(DATEADD('ms',1,'6/30/2005 1:47:56.998 AM'))

Refer to the SQL Server DATEADD function for supported date parts.

DATEDIFF

Microsoft.VisualBasic.DateDiff

SELECT DATEDIFF('ms','6/30/2005 1:46:55.998 AM','6/30/2005 1:47:56.998 AM')

Refer to the SQL Server DATEDIFF function for supported date parts.

DATEPART

Microsoft.VisualBasic.DatePart

SELECT DATEPART('year','6/30/2005 1:47:56.998 AM')

Refer to the SQL Server DATEPART function for supported date parts.

NEWID

System.Guid.NewGuid

SELECT newid()

ISDATE

Microsoft.VisualBasic.Information

SELECT IsDate('7/16/2005 6:28:55.999 PM'), isdate('test'), isdate(1), isdate(NULL)

ISNUMERIC

Microsoft.VisualBasic.Information

SELECT isnumeric('test'), isnumeric(1.1), isnumeric('$1.1'),isdate(NULL)

DATALENGTH

Microsoft.VisualBasic.Strings

SELECT DATALENGTH(description) from [item_info]

RAND

Microsoft.VisualBasic.VBMath.Rnd

SELECT rand(), rand(), rand(cast(getdate() as int)), rand(NULL)

HEX

Microsoft.VisualBasic.Conversion.Hex

SELECT HEX(1023)
UriIsAbsolute System.Uri.IsAbsolute
SELECT UriIsAbsolute('http://www.paschidev.com/downloads.aspx'), UriIsAbsolute('downloads.aspx'), UriIsAbsolute('')

NULL is returned for unparseable URIs.

UriIsValid None
SELECT UriIsValid('http://www.paschidev.com/downloads.aspx'), UriIsValid('')
UriCombine None
SELECT UriCombine('http://www.paschidev.com/downloads.aspx', 'buy.aspx')