17.06.2013 Views

Beginning Microsoft SQL Server 2008 ... - S3 Tech Training

Beginning Microsoft SQL Server 2008 ... - S3 Tech Training

Beginning Microsoft SQL Server 2008 ... - S3 Tech Training

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Appendix A: System Functions<br />

HOST_ID<br />

The HOST_ID function returns the ID of the workstation. The syntax is as follows:<br />

HOST_ID()<br />

HOST_NAME<br />

The HOST_NAME function returns the name of the workstation. The syntax is as follows:<br />

HOST_NAME()<br />

IDENT_CURRENT<br />

The IDENT_CURRENT function returns the last identity value created for a table, within any session or<br />

scope of that table. This is exactly like @@IDENTITY and SCOPE_IDENTITY; however, this has no limit to<br />

the scope of its search to return the value.<br />

The syntax is as follows:<br />

IDENT_CURRENT(‘’)<br />

The table_name is the table for which you wish to find the current identity.<br />

IDENT_INCR<br />

The IDENT_INCR function returns the increment value specified during the creation of an identity column<br />

in a table or view that has an identity column. The syntax is as follows:<br />

IDENT_INCR(‘’)<br />

The table_or_view parameter is an expression specifying the table or view to check for a valid identity<br />

increment value.<br />

IDENT_SEED<br />

The IDENT_SEED function returns the seed value specified during the creation of an identity column in a<br />

table or a view that has an identity column. The syntax is as follows:<br />

IDENT_SEED(‘’)<br />

The table_or_view parameter is an expression specifying the table or view to check for a valid identity<br />

increment value.<br />

@@IDENTITY<br />

642<br />

Returns the last identity value created by the current connection.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!