July 19, 2012 at 9:15 am
function in sql server?
Thanks
Alok
July 19, 2012 at 9:19 am
four i would say, built in functions, plus three kinds of user defined functions: scalar, multi statement table functions and inline table functions.
-edit]
from my notes of SQL server object types, i didn't include agragate functions or CLR types in the offhand list above:
OBJECT TYPES
AF = Aggregate function (CLR)AGGREGATE_FUNCTION
C = CHECK constraintCHECK_CONSTRAINT
D = DEFAULT (constraint or stand-alone)DEFAULT_CONSTRAINT
F = FOREIGN KEY constraintFOREIGN_KEY_CONSTRAINT
FN = SQL scalar functionSQL_SCALAR_FUNCTION
FS = Assembly (CLR) scalar-functionCLR_SCALAR_FUNCTION
FT = Assembly (CLR) table-valued functionCLR_TABLE_VALUED_FUNCTION
IF = SQL inline table-valued functionSQL_INLINE_TABLE_VALUED_FUNCTION
IT = Internal tableINTERNAL_TABLE
P = SQL Stored ProcedureSQL_STORED_PROCEDURE
PC = Assembly (CLR) stored-procedureCLR_STORED_PROCEDURE
PG = Plan guidePLAN_GUIDE
PK = PRIMARY KEY constraintPRIMARY_KEY_CONSTRAINT
R = Rule (old-style, stand-alone)RULE
RF = Replication-filter-procedureREPLICATION_FILTER_PROCEDURE
S = System base tableSYSTEM_TABLE
SN = SynonymSYNONYM
SQ = Service queueSERVICE_QUEUE
TA = Assembly (CLR) DML triggerCLR_TRIGGER
TF = SQL table-valued-functionSQL_TABLE_VALUED_FUNCTION
TR = SQL DML triggerSQL_TRIGGER
TT = Table typeTABLE_TYPE
U = Table (user-defined)USER_TABLE
UQ = UNIQUE constraintUNIQUE_CONSTRAINT
V = ViewVIEW
X = Extended stored procedureEXTENDED_STORED_PROCEDURE
Lowell
July 19, 2012 at 11:04 am
Function Categorization:
1) System Functions
2) User Defined Functions
2.1) Scalar Functions
2.1) In-Line table valued Functions
2.1) Multi-statement table valued Function
~ Lokesh Vij
Link to my Blog Post --> www.SQLPathy.com[/url]
Follow me @Twitter
July 19, 2012 at 11:07 am
Two types. Deterministic and non-deterministic.
In other words, what do you mean by "types" of functions?
- Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
Property of The Thread
"Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon
July 19, 2012 at 11:17 am
Further to add on; scalar functions are always deterministic.
- Lokesh
~ Lokesh Vij
Link to my Blog Post --> www.SQLPathy.com[/url]
Follow me @Twitter
July 19, 2012 at 11:20 am
lokeshvij (7/19/2012)
Further to add on; scalar functions are always deterministic.
Sure about that?
All scalar udfs will always return the same value if called multiple times with the same parameter?
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
July 19, 2012 at 11:21 am
lokeshvij (7/19/2012)
Further to add on; scalar functions are always deterministic.- Lokesh
No they're not. It's easy to make nondeterministic scalar UDFs.
- Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
Property of The Thread
"Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon
July 19, 2012 at 11:43 am
ok, so my answer is D. Seven function types. Final Answer.
(...waiting for the failure buzzer.....)
my thinking is there are the Built in functions plus these six others.
AF = Aggregate function (CLR) AGGREGATE_FUNCTION
FS = Assembly (CLR) scalar-function CLR_SCALAR_FUNCTION
FT = Assembly (CLR) table-valued function CLR_TABLE_VALUED_FUNCTION
IF = SQL inline table-valued function SQL_INLINE_TABLE_VALUED_FUNCTION
FN = SQL scalar function SQL_SCALAR_FUNCTION
TF = SQL table-valued-function SQL_TABLE_VALUED_FUNCTION
Lowell
Viewing 8 posts - 1 through 7 (of 7 total)
You must be logged in to reply to this topic. Login to reply