Export (0) Print
Expand All
ABS
ALL
AND
ANY
AVG
bit
COS
COT
DAY
EXP
GO
IN
LEN
LOG
MAX
MIN
NOT
OR
PI
SET
SIN
STR
SUM
TAN
USE
VAR
Expand Minimize

USER_ID

SQL Server 2000

Returns a user's database identification number.

Syntax

USER_ID ( [ 'user' ] )

Arguments

'user'

Is the username to be used. user is nchar. If a char value is specified, it is implicitly converted to nchar.

Return Types

smallint

Remarks

When user is omitted, the current user is assumed. Parentheses are required.

USER_ID can be used in the select list, in the WHERE clause, and anywhere an expression is allowed. For more information, see Expressions.

Examples

This example returns the identification number for user Harold.

SELECT USER_ID('Harold')

See Also

Security Functions

Show:
© 2014 Microsoft