iam able to get only Deleted details and also updated details from table.
Not username who logged through application and Delete the data..
So i any other way get application logged username in Sql trigger......
Thanks in Advance ..
Rajeshkumar
Hi,
If you couldn't find username and userid from table, you could use another way to store them in the table. Did you get the username and userid when he login in the application? You could store them in the parameters, and after deleting data, use insert
clause to insert these two values into your table instead of Sql trigger.
Thanks.
Please mark the replies as answers if they help or unmark if not.
Feedback to us
rajeshkumar1...
Member
1 Points
16 Posts
How to get username in Delete trigger
Apr 26, 2012 07:20 AM|LINK
how to get username ,userid in delete trigger ..........
i have created delete tigger all tables.
when user deleting data through application.
deleteind details saved in another table ,but i not able get username or userid ...
bakamaru
Member
128 Points
76 Posts
Re: How to get username in Delete trigger
Apr 26, 2012 08:28 AM|LINK
select username,userid from DELETED
In triggers INSERTED and DELETED are availble to select data from
rajeshkumar1...
Member
1 Points
16 Posts
Re: How to get username in Delete trigger
Apr 27, 2012 06:22 AM|LINK
since data is deleted through application...
iam able to get only Deleted details and also updated details from table.
Not username who logged through application and Delete the data..
So i any other way get application logged username in Sql trigger......
Thanks in Advance ..
Rajeshkumar
Chen Yu - MS...
All-Star
21584 Points
2493 Posts
Microsoft
Re: How to get username in Delete trigger
Apr 27, 2012 09:57 AM|LINK
Hi,
If you couldn't find username and userid from table, you could use another way to store them in the table. Did you get the username and userid when he login in the application? You could store them in the parameters, and after deleting data, use insert clause to insert these two values into your table instead of Sql trigger.
Thanks.
Feedback to us
Develop and promote your apps in Windows Store