sql server default value to be currently logged in user

How can i set the sql server default value for a column to be the value of the currently logged in user?
LVL 12
Norman MainaAsked:
Who is Participating?
 
EvilPostItCommented:
use the system_user function as the default value.
0
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
you want either the user name (relevant to the db): USER_NAME()
http://msdn.microsoft.com/en-us/library/ms188014.aspx

or the login name: SUSER_NAME()
http://msdn.microsoft.com/en-us/library/ms187934.aspx
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.