Link to home
Start Free TrialLog in
Avatar of Cree
Cree

asked on

SQL Set current user as default value or Binding

When creating a table, Can I set a column to automatically grab the user's name when a new row is created?
Avatar of Darius Ghassem
Darius Ghassem
Flag of United States of America image

The link explains in detail on adding a trigger that will update the column when the row is insterted.

http://sqlserver2000.databases.aspfaq.com/how-do-i-audit-changes-to-sql-server-data.html
Avatar of Cree
Cree

ASKER

Thanks,
I did it but i guess it is not doing what I want it to do.

I have this table linked to Access.  When a user is adding a new row to the table (via a report) I want the USER column to put their sql user name in there automatically.

But it may not be necessary to have SQL server name for every user who can access Access.
We can always capture user name of user accessing Access and pass it on to MSSQL for update.
ASKER CERTIFIED SOLUTION
Avatar of Raja Jegan R
Raja Jegan R
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial