| Author |
Topic |
|
kok_sheng2000
Starting Member
10 Posts |
Posted - 2012-05-15 : 00:20:18
|
| Hi, Everyone.I want to keep the log detail for my recordin MS SQL Database when user Delete a record.So I have a SQL Trigger Delete Function in related Table.What I want to keep is the User Name From My Software's Userwho delete the record, But i have no any field keep in the table,Is that MS SQL have any session variable or temp variable thatcan let my system to update and run at once together with Trigger Delete and so keep in the log detail table ? |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2012-05-15 : 00:44:16
|
| make use of SUSER_SNAME() function to get username------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
|
kok_sheng2000
Starting Member
10 Posts |
Posted - 2012-05-15 : 00:51:10
|
| Hi, visakh16, Thanks For Reply .I want the user name from my software login user name not the MS SQL Login User name. I Means a variable user name send from my programduring Delete Operation. Tq |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2012-05-15 : 01:13:28
|
quote: Originally posted by kok_sheng2000 Hi, visakh16, Thanks For Reply .I want the user name from my software login user name not the MS SQL Login User name. I Means a variable user name send from my programduring Delete Operation. Tq
do you've a table storing those usernames in sql server? or is it domain username?------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
|
kok_sheng2000
Starting Member
10 Posts |
Posted - 2012-05-15 : 01:21:25
|
| My Program Current Login Username, I have keep it Database,But The problem is :- 1> There are multi-user login at a time. 2> During Trigger Delete, username that delete not send to trigger.So, What i want to know is, how or any other way to Send / communicatewith Trigger Delete when a user delete a record. Thank in advanced ... |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2012-05-15 : 22:09:18
|
quote: Originally posted by kok_sheng2000 My Program Current Login Username, I have keep it Database,But The problem is :- 1> There are multi-user login at a time. 2> During Trigger Delete, username that delete not send to trigger.So, What i want to know is, how or any other way to Send / communicatewith Trigger Delete when a user delete a record. Thank in advanced ...
you've capture and send that information manually unless its not a domain or standard sql user------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
|
kok_sheng2000
Starting Member
10 Posts |
Posted - 2012-05-16 : 21:46:24
|
| Oop, is like that , then no choice ... Thanks for help me ... |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2012-05-16 : 21:49:42
|
np ------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
|
|