Functions

See Reference Manual: Building Blocks for details.

abs

abs(numeric_expression)

acos

acos(cosine)

ascii

ascii(char_expr | uchar_expr)

asin

asin(sine)

atan

atan(tangent )

atn2

atn2(sine, cosine)

avg

avg([all | distinct] expression)

ceiling

ceiling(value)

char

char(integer_expr)

charindex

charindex(expression1, expression2)

char_length

char_length(char_expr | uchar_expr)

col_length

col_length(object_name, column_name)

col_name

col_name(object_id, column_id[, database_id])

compare

compare ({char_expression1|uchar_expression1}, 
	{char_expression2|uchar_expression2}), 
	[{collation_name | collation_ID}] 

convert

convert (datatype [(length) | (precision[, scale])] 
	[null | not null], expression [, style])

cos

cos(angle)

cot

cot(angle)

count

count([all | distinct] expression)

curunreservedpgs

curunreservedpgs(dbid, lstart, unreservedpgs)

data_pgs

data_pgs([dbid], object_id, {data_oam_pg_id | index_oam_pg_id}

datalength

datalength(expression)

dateadd

dateadd(date_part, integer, {date | time | datetime)

datediff

datediff(datepart, {date1, date2 | time1 |time2 | datetime1 | datetime2})

datename

datename (datepart, {date | time | datetime})

datepart

datepart(date_part, {date |time |datetime})

day

day(date_expression)

db_id

db_id(database_name)

db_name

db_name([database_id])

degrees

degrees(numeric)

derived_stat

derived_stat({object_name | object_id}, {index_name | index_id}, “statistic”)

difference

difference(expr1,expr2)

exp

exp(approx_numeric)

floor

floor(numeric)

get_appcontext

get_appcontext (“context_name”, “attribute_name”)

getdate

getdate()

hextoint

hextoint (hexadecimal_string)

host_id

host_id()

host_name

host_name()

identity_burn_max

identity_burn_max(table_name)

index_col

index_col (object_name, index_id, key_# [, user_id])

index_colorder

index_colorder (object_name, index_id, key_# [, user_id])

inttohex

inttohex (integer_expression)

isnull

isnull(expression1, expression2)

is_sec_service_on

is_sec_service_on(security_service_nm)

lct_admin

lct_admin({{"lastchance" | "logfull" | "reserved_for_rollbacks"},
	database_id
	|"reserve", {log_pages | 0 }
	| "abort", process-id [, database-id]})

left

left(character_expression, integer_expression)

len

len(string_expression)

license_enabled

license_enabled("ase_server" | "ase_ha" | "ase_dtm" | "ase_java" | 
	"ase_asm")

list_appcontext

list_appcontext (["context_name"])

lockscheme

lockscheme(object_name)

Or

lockscheme(object_id [, db_id])

log

log(approx_numeric)

log10

log10(approx_numeric)

lower

lower(char_expr | uchar_expr)

ltrim

ltrim(char_expr | uchar_expr)

max

max(expression)

min

min(expression)

month

month(date_expression)

mut_excl_roles

mut_excl_roles (role1, role2 [membership | activation])

newid

newid([optionflag]))

next_identity

next_identity(table_name)

object_id

object_id(object_name)

object_name

object_name(object_id[, database_id])

pagesize

pagesize(object_name [, index_name])
or,
pagesize(object_id [,db_id [, index_id]])

patindex

patindex("%pattern%", char_expr|uchar_expr [, using 
	{bytes | characters | chars} ] )

pi

pi()

power

power(value, power)

proc_role

proc_role ("role_name")

ptn_data_pgs

ptn_data_pgs(object_id, partition_id)

radians

radians(numeric)

rand

rand([integer])

replicate

replicate (char_expr | uchar_expr, integer_expr)

reserved_pgs

reserved_pgs(object_id, {doampg | ioampg})

reverse

reverse(expression | uchar_expr)

right

right(expression, integer_expr)

rm_appcontext

rm_appcontext (“context_name”, “attribute_name”)

role_contain

role_contain("role1", "role2")

role_id

role_id("role_name")

role_name

role_name(role_id)

round

round(number, decimal_places)

rowcnt

rowcnt(sysindexes.doampg)

rtrim

rtrim(char_expr | uchar_expr)

set_appcontext

set_appcontext (“context_name, “attribute_name”, “attribute_value”)

show_role

show_role()

show_sec_services

show_sec_services()

sign

sign(numeric)

sin

sin(approx_numeric)

sortkey

sortkey (char_expression | uchar_expression) [, {collation_name | 
	collation_ID}])

soundex

soundex(char_expr | uchar_expr)

space

space(integer_expr)

square

square(numeric_expression)

sqrt

sqrt(approx_numeric)

str

str(approx_numeric [, length [, decimal] ])

str_replace

replace("string_expression1", "string_expression2", "string_expression3")

stuff

stuff(char_expr1 | uchar_expr1, start, length, char_expr2 | uchar_expr2)

substring

substring(expression, start, length )

sum

sum([all | distinct] expression)

suser_id

suser_id([server_user_name])

suser_name

suser_name([server_user_id])

syb_quit()

syb_quit()

syb_sendmsg

syb_sendmsg ip_address, port_number, message

tan

tan(angle)

tempdb_id

tempdb_id()

textptr

textptr(column_name)

textvalid

textvalid("table_name.column_name", textpointer)

to_unichar

to_unichar (integer_expr)

tsequal

tsequal(browsed_row_timestamp, stored_row_timestamp)

uhighsurr

uhighsurr(uchar_expr, start)

ulowsurr

ulowsurr(uchar_expr, start)

upper

upper(char_expr)

uscalar

uscalar(uchar_expr)

used_pgs

used_pgs(object_id, doampg, ioampg)

user

user

user_id

user_id([user_name])

user_name

user_name([user_id]) 

valid_name

valid_name(character_expression)

valid_user

valid_user(server_user_id)

year

year(date_expression)