• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 476
  • Last Modified:

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?
0
NormanMaina
Asked:
NormanMaina
2 Solutions
 
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

Featured Post

Fill in the form and get your FREE NFR key NOW!

Veeam is happy to provide a FREE NFR server license to certified engineers, trainers, and bloggers.  It allows for the non‑production use of Veeam Agent for Microsoft Windows. This license is valid for five workstations and two servers.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now