Function |
Description |
IDENT_INCR |
Returns the increment value (returned as numeric (@@MAXPRECISION, 0)) specified during the creation of an identity column in a table or view that has an identity column.
Syntax:
IDENT_INCR( '<table_or_view>' )
|
IDENT_SEED |
Returns the original seed value (returned as numeric (@@MAXPRECISION, 0)) that was specified when an identity column in a table or a view was created. Changing the current value of an identity column by using DBCC CHECKIDENT does not change the value returned by this function.
Syntax:
IDENT_SEED( '<table_or_view>' )
|
@@IDENTITY |
Returns the last-inserted identity value.
Syntax:
@@IDENTITY
|
IDENTITY |
This system function is used only in a SELECT statement with an INTO table clause to insert an identity column into a new table. Although similar, the IDENTITY function is not the IDENTITY property that is used with CREATE TABLE and ALTER TABLE.
Syntax:
IDENTITY( <data_type>, [ , <seed>, <increment> ] ) AS <column_name>
|
ISDATE |
Returns 1 if an input expression is a valid date or time value of datetime or smalldatetime data types; otherwise, 0.
Syntax:
ISDATE ( <expression> )
|
ISNULL |
Replaces NULL with the specified replacement value.
Syntax:
ISNULL ( <check_expression>, <replacement_value> )
|
ISNUMERIC |
Determines whether an expression is a value numeric type.
Syntax:
ISNUMERIC ( <expression> )
|
NEWID |
Created a unique value of type uniqueidentifier.
Syntax:
NEWID()
|
NULLIF |
Returns a NULL value if the two specified expressions are equal.
Syntax:
NULLIF( <expression>, <expression> )
|
PARSENAME |
Returns the specified part of an object name. The parts of an object that can be retrieved are the object name, owner name, database name and server name.
Syntax:
PARSENAME ( '<object_name>', <object_piece> )
|
ORIGINAL_LOGIN |
Returns the name of the login that connected to the instance of SQL Server. This function can be used to return the identity of the original login in sessions in which there are many explicit or implicit context switches.
Syntax:
ORIGINAL_LOGIN()
|
@@ROWCOUNT |
Returns the number of rows affected by the last statement. If the number of rows is more than 2 billion, use ROWCOUNT_BIG.
Syntax:
@@ROWCOUNT
|
ROWCOUNT_BIG |
Returns the number of rows affected by the last statement executed. This functon operates like @@ROWCOUNT, except the return type of ROWCOUNT_BIG is bigint.
Syntax:
ROWCOUNT_BIG()
|
SCOPE_IDENTITY |
Returns the last identity value inserted into an identity column in the same scope. A scope is a module: a stored procedure, trigger, function, or batch. Therefore, two statements are in the same scope if they are in the same stored procedure, function or batch.
Syntax:
SCOPE_IDENTITY()
|
SERVERPROPERTY |
Returns property information about the server instance.
Syntax:
SERVERPROPERTY( '<property_name>' )
|
SESSIONPROPERTY |
Returns the SET options settings of a session.
Syntax:
SERVERPROPERTY( '<set_option>' )
|
SESSION_USER |
Returns the user name of the current context in the current database.
Syntax:
SESSION_USER
|
STATS_DATE |
Returns the date that the statistics for the specified table were last updated.
Syntax:
STATS_DATE ( <table_id>, <stats_id> )
|
sys.dm_db_index_physical_stats |
Returns size and fragmentation information for the data and indexes of the specified table or view. For an index, one row is returned for each level of the B-tree in each partition.
For a heap, one row is returned for the IN_ROW_DATA allocation unit of each partition. For large object (LOB) data, one row is returned for the LOB_DATA allocation unit of each partition. If row-overflow data exists in the table, one row is returned
for the ROW_OVERFLOW_DATA allocation unit in each partition.
Syntax:
sys.dm_db_index_physical_stats ( { <database_id> | NULL | 0 | DEFAULT } ,
{ <object_id> | NULL | 0 | DEFAULT } ,
{ <index_id> | NULL | 0 | -1 | DEFAULT } ,
{ <partition_number> | NULL | 0 | DEFAULT } ,
{ <mode> | NULL | DEFAULT }
|
SYSTEM_USER |
Allows a system-supplied value for the current login to be inserted into a table when no default value is specified.
Syntax:
SYSTEM_USER
|
@@TRANCOUNT |
Returns the number of active transactions for the current connection.
Syntax:
@@TRANCOUNT
|
UPDATE() |
Returns a Boolena value that indicates whether an INSERT or UPDATE attempt was made on a specified column of a table or view. UPDATE() is used anywhere inside the body of a Transact-SQL INSERT or UPDATE trigger to test whether the trigger should execute certain actions.
Syntax:
UPDATE ( <column_name> )
|
USER_NAME |
Returns a database user name from a specified identification number.
Syntax:
USER_NAME( [ <user_id> ] )
|
XACT_STATE |
Returns the user transaction state of a current running request. XACT_STATE indicates whether the request has an active user transaction, and whether the transaction is capable of being committed.
Syntax:
XACT_STATE()
|