Returns the ID number of a principal in the current database.
DATABASE_PRINCIPAL_ID ( 'principal_name' )
Is an expression of type sysname that represents the principal.
When principal_name is omitted, the ID of the current user is returned. The parentheses are required.
SELECT DATABASE_PRINCIPAL_ID('random_principal_name') ;