SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


How Many type of Function in SQL Server ?


How Many type of Function in SQL Server ?

Author
Message
Alok Kumar Sharma
Alok Kumar Sharma
Valued Member
Valued Member (65 reputation)Valued Member (65 reputation)Valued Member (65 reputation)Valued Member (65 reputation)Valued Member (65 reputation)Valued Member (65 reputation)Valued Member (65 reputation)Valued Member (65 reputation)

Group: General Forum Members
Points: 65 Visits: 68
function in sql server?

Thanks
Alok
Lowell
Lowell
One Orange Chip
One Orange Chip (28K reputation)One Orange Chip (28K reputation)One Orange Chip (28K reputation)One Orange Chip (28K reputation)One Orange Chip (28K reputation)One Orange Chip (28K reputation)One Orange Chip (28K reputation)One Orange Chip (28K reputation)

Group: General Forum Members
Points: 28291 Visits: 39955
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 constraint CHECK_CONSTRAINT
D = DEFAULT (constraint or stand-alone) DEFAULT_CONSTRAINT
F = FOREIGN KEY constraint FOREIGN_KEY_CONSTRAINT
FN = SQL scalar function SQL_SCALAR_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
IT = Internal table INTERNAL_TABLE
P = SQL Stored Procedure SQL_STORED_PROCEDURE
PC = Assembly (CLR) stored-procedure CLR_STORED_PROCEDURE
PG = Plan guide PLAN_GUIDE
PK = PRIMARY KEY constraint PRIMARY_KEY_CONSTRAINT
R = Rule (old-style, stand-alone) RULE
RF = Replication-filter-procedure REPLICATION_FILTER_PROCEDURE
S = System base table SYSTEM_TABLE
SN = Synonym SYNONYM
SQ = Service queue SERVICE_QUEUE
TA = Assembly (CLR) DML trigger CLR_TRIGGER
TF = SQL table-valued-function SQL_TABLE_VALUED_FUNCTION
TR = SQL DML trigger SQL_TRIGGER
TT = Table type TABLE_TYPE
U = Table (user-defined) USER_TABLE
UQ = UNIQUE constraint UNIQUE_CONSTRAINT
V = View VIEW
X = Extended stored procedure EXTENDED_STORED_PROCEDURE



Lowell

--
help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

Lokesh Vij
Lokesh Vij
SSCrazy
SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)

Group: General Forum Members
Points: 2062 Visits: 1599
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

Guidelines for quicker answers on T-SQL question
Guidelines for answers on Performance questions

Link to my Blog Post --> www.SQLPathy.com

Follow me @Twitter


GSquared
GSquared
SSC-Insane
SSC-Insane (23K reputation)SSC-Insane (23K reputation)SSC-Insane (23K reputation)SSC-Insane (23K reputation)SSC-Insane (23K reputation)SSC-Insane (23K reputation)SSC-Insane (23K reputation)SSC-Insane (23K reputation)

Group: General Forum Members
Points: 23561 Visits: 9730
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
Lokesh Vij
Lokesh Vij
SSCrazy
SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)

Group: General Forum Members
Points: 2062 Visits: 1599
Further to add on; scalar functions are always deterministic.

- Lokesh

~ Lokesh Vij

Guidelines for quicker answers on T-SQL question
Guidelines for answers on Performance questions

Link to my Blog Post --> www.SQLPathy.com

Follow me @Twitter


GilaMonster
GilaMonster
SSC Guru
SSC Guru (87K reputation)SSC Guru (87K reputation)SSC Guru (87K reputation)SSC Guru (87K reputation)SSC Guru (87K reputation)SSC Guru (87K reputation)SSC Guru (87K reputation)SSC Guru (87K reputation)

Group: General Forum Members
Points: 87623 Visits: 45272
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

We walk in the dark places no others will enter
We stand on the bridge and no one may pass


GSquared
GSquared
SSC-Insane
SSC-Insane (23K reputation)SSC-Insane (23K reputation)SSC-Insane (23K reputation)SSC-Insane (23K reputation)SSC-Insane (23K reputation)SSC-Insane (23K reputation)SSC-Insane (23K reputation)SSC-Insane (23K reputation)

Group: General Forum Members
Points: 23561 Visits: 9730
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
Lowell
Lowell
One Orange Chip
One Orange Chip (28K reputation)One Orange Chip (28K reputation)One Orange Chip (28K reputation)One Orange Chip (28K reputation)One Orange Chip (28K reputation)One Orange Chip (28K reputation)One Orange Chip (28K reputation)One Orange Chip (28K reputation)

Group: General Forum Members
Points: 28291 Visits: 39955
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

--
help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search