Returns the login profile ID of the specified login profile name, or the login profile ID of the login profile associated with the current login or the specified login name.
lprofile_id(name)
select lprofile_id('intern_lr')
------------------ 3
select lprofile_id()
------------------ 4
select lprofile_id('jon')
------------------ 5
Specify a login profile name – lprofile_id returns the corresponding login profile ID. If you specify a login name, lprofile_id returns the associated (if any) login profile ID.
Do not specify name – lprofile_id returns the login profile ID of the current login.
ANSI SQL – Compliance level: Transact-SQL extension.
The permission checks for lprofile_id differ based on your granular permissions settings.
Granular Permissions | Description |
---|---|
Enabled | With granular permissions enabled, any user can execute lprofile_id to return the ID of their own profile. You must have manage any login profile permission to execute lprofile_id and retrieve the profile ID of other users. |
Disabled | With granular permissions disabled, any user can execute lprofile_id to return the ID of their own profile. You must be a user with sso_role to execute lprofile_id and retrieve the profile ID of other users. |