Вы находитесь на странице: 1из 5

Cc hm trong SQL Server

Function category Configuration Functions Cursor Functions Date and Time Functions Mathematical Functions Metadata Functions Security Functions String Functions System Functions System Statistical Functions Text and Image Functions Explanation Returns information about the current configuration. Returns information about cursors. Performs an operation on a date and time input value and returns either a string, numeric, or date and time value. Performs a calculation based on input values provided as parameters to the function, and returns a numeric value. Returns information about the database and database objects. Returns information about users and roles. Performs an operation on a string (char or varchar) input value and returns a string or numeric value. Performs operations and returns information about values, objects, and settings in Microsoft SQL Server. Returns statistical information about the system. Performs an operation on a text or image input values or column, and returns information about the value.

1. Configuration Functions

@@DATEFIRST @@DBTS @@LANGID @@LANGUAGE @@LOCK_TIMEOUT @@MAX_CONNECTIONS @@MAX_PRECISION @@NESTLEVEL

@@OPTIONS @@REMSERVER @@SERVERNAME @@SERVICENAME @@SPID @@TEXTSIZE @@VERSION

2. Cursor Functions
These scalar functions return information about cursors. @@CURSOR_ROWS CURSOR_STATUS @@FETCH_STATUS

3. Date and Time Functions


These scalar functions perform an operation on a date and time input value and return a string, numeric, or date and time value. This table lists the date and time functions and their determinism property. For more information about function determinism, see Deterministic and Nondeterministic Functions.

Function DATEADD

Determinism Deterministic

DATEDIFF DATENAME DATEPART

Deterministic Nondeterministic Deterministic except when used as DATEPART (dw, date). dw, the weekday datepart, depends on the value set by SET DATEFIRST, which sets the first day of the week. Deterministic Nondeterministic Nondeterministic Deterministic Deterministic

DAY GETDATE GETUTCDATE MONTH YEAR

4. Mathematical Functions

These scalar functions perform a calculation, usually based on input values provided as arguments, and return a numeric value.

ABS ACOS ASIN ATAN ATN2 CEILING COS COT

DEGREES EXP FLOOR LOG LOG10 PI POWER RADIANS

RAND ROUND SIGN SIN SQUARE SQRT TAN

5. Metadata Functions
COL_LENGTH COL_NAME COLUMNPROPERTY DATABASEPROPERTY

These scalar functions return information about the database and database objects.

fn_listextendedproperty FULLTEXTCATALOGPROPERTY FULLTEXTSERVICEPROPERTY INDEX_COL INDEXKEY_PROPERTY INDEXPROPERTY OBJECT_ID OBJECT_NAME OBJECTPROPERTY @@PROCID SQL_VARIANT_PROPERTY TYPEPROPERTY

DATABASEPROPERTYEX DB_ID DB_NAME FILE_ID FILE_NAME FILEGROUP_ID FILEGROUP_NAME FILEGROUPPROPERTY FILEPROPERTY 6. Security Functions

These scalar functions return information about users and roles.

fn_trace_geteventinfo

IS_SRVROLEMEMBER

fn_trace_getfilterinfo fn_trace_getinfo fn_trace_gettable HAS_DBACCESS IS_MEMBER 7. String Functions

SUSER_SID SUSER_SNAME USER_ID USER

These scalar functions perform an operation on a string input value and return a string or numeric value.

ASCII CHAR CHARINDEX DIFFERENCE LEFT LEN LOWER LTRIM 8. System Functions

NCHAR PATINDEX REPLACE QUOTENAME REPLICATE REVERSE RIGHT RTRIM

SOUNDEX SPACE STR STUFF SUBSTRING UNICODE UPPER

These scalar functions perform operations on and return information about values, objects, and settings in Microsoft SQL Server. This table lists the system functions and their determinism property. For more information about function determinism, see Deterministic and Nondeterministic Functions.

Function APP_NAME CASE expression CAST and CONVERT COALESCE COLLATIONPROPERTY CURRENT_TIMESTAMP CURRENT_USER DATALENGTH @@ERROR fn_helpcollations fn_servershareddrives fn_virtualfilestats FORMATMESSAGE GETANSINULL HOST_ID HOST_NAME IDENT_CURRENT

Determinism Nondeterministic Deterministic Deterministic unless used with datetime, smalldatetime, or sql_variant. Deterministic Nondeterministic Nondeterministic Nondeterministic Deterministic Nondeterministic Deterministic Nondeterministic Nondeterministic Nondeterministic Nondeterministic Nondeterministic Nondeterministic Nondeterministic

IDENT_INCR IDENT_SEED @@IDENTITY IDENTITY (Function) ISDATE

Nondeterministic Nondeterministic Nondeterministic Nondeterministic Deterministic only if used with the CONVERT function, the CONVERT style parameter is specified and the style parameter is not equal to 0, 100, 9, or 109. Styles 0 and 100 use the default format mon dd yyyy hh:miAM (or PM). Styles 9 and 109 use the default format plus milliseconds mon dd yyyy hh:mi:ss:mmmAM (or PM). Deterministic Deterministic Nondeterministic Deterministic Deterministic Nondeterministic Nondeterministic Nondeterministic Nondeterministic Nondeterministic Nondeterministic Nondeterministic Nondeterministic Nondeterministic Nondeterministic Nondeterministic

ISNULL ISNUMERIC NEWID NULLIF PARSENAME PERMISSIONS @@ROWCOUNT ROWCOUNT_BIG SCOPE_IDENTITY SERVERPROPERTY SESSIONPROPERTY SESSION_USER STATS_DATE SYSTEM_USER @@TRANCOUNT USER_NAME 9. System Statistical Functions

These scalar functions return statistical information about the system.

@@CONNECTIONS @@CPU_BUSY fn_virtualfilestats @@IDLE @@IO_BUSY @@PACKET_ERRORS

@@PACK_RECEIVED @@PACK_SENT @@TIMETICKS @@TOTAL_ERRORS @@TOTAL_READ @@TOTAL_WRITE

10. Text and Image Functions


These scalar functions perform an operation on a text or image input value or column and return information about the value. PATINDEX TEXTPTR TEXTVALID

Вам также может понравиться