user  user_name

Chapter 2: Transact-SQL Functions

user_id

Description

Returns the ID number of the specified user or of the current user in the database.

Syntax

user_id([user_name])

Parameters

user_name

is the name of the user.

Examples

Example 1

select user_id()
------ 
    1 

Example 2

select user_id("margaret")
------
    4 

Usage

Standards

ANSI SQL – Compliance level: Transact-SQL extension.

Permissions

You must System Administrator or System Security Officer to use this function on a user_name other than your own.

See also

Commands setuser

Functions suser_id, user_name





Copyright © 2005. Sybase Inc. All rights reserved. user_name

View this book as PDF