OS Username Scalar Function
Would be useful to have a scalar function that returns the OS user login name, rather than the dictionary user name which is what USER() returns for dictionary connections. Perhaps add an option to the USER() scalar to alter its behavior in this way.
3 comments
-
oscar hernandez
commented
If the function is an scalar user_os(); by example, You can use it in the default value of the field, in order to have the person that create the record, Or changed it (using it inside a trigger), It would be great if there is a function like p_SetApplicationID:
sp_setuser_os(cUser_Logged). -
Rodd Graham
commented
Possible alternative: Allow the ACE32 client to substitute the OS username for the database login username in the connection string. Similar to using integrated authentication in MS Sql Server except that the password would still need to be provided unless ADS learns how to use external user credentials. IMO, should be a unique connection string verb like "ADS_USE_OS_UID". Then USER() works.
-
joachimd
commented
other idea: enhance sp_mgGetConnectedUsers to contain the unique connection id (connection handle) and provide a function to retrieve it in SQL. Then (together with some other suggestions) you can query that SP to get _ALL_ information about computername, username, ip, terminal client ip, ...
SELECT * FROM (EXECUTE PROCEDURE sp_mgGetConnectedUsers()) cu
WHERE cu.[ConnectionId] = ConnectionID();