Click here to Skip to main content
16,016,623 members
Home / Discussions / Database
   

Database

 
AnswerRe: Isolation Level Pin
Eddy Vluggen13-Jan-15 23:44
professionalEddy Vluggen13-Jan-15 23:44 
GeneralRe: Isolation Level Pin
Member 1137363814-Jan-15 0:30
Member 1137363814-Jan-15 0:30 
GeneralRe: Isolation Level Pin
Eddy Vluggen14-Jan-15 2:56
professionalEddy Vluggen14-Jan-15 2:56 
GeneralRe: Isolation Level Pin
Member 1137363814-Jan-15 16:57
Member 1137363814-Jan-15 16:57 
AnswerRe: Isolation Level Pin
Eddy Vluggen15-Jan-15 9:56
professionalEddy Vluggen15-Jan-15 9:56 
GeneralRe: Isolation Level Pin
Member 1137363815-Jan-15 17:15
Member 1137363815-Jan-15 17:15 
GeneralRe: Isolation Level Pin
Eddy Vluggen16-Jan-15 7:58
professionalEddy Vluggen16-Jan-15 7:58 
QuestionAudit Tables for Many-Many Relationships Pin
Matt U.13-Jan-15 3:40
Matt U.13-Jan-15 3:40 
We're using Entity Framework 4, ASP.NET MVC 4 and SQL Server 2008 R2. We have some join tables for several entities, for many-many relationships. I'm working to create audit tables/data for each of these relationships/join tables. So far in my research, I've found that triggers are common. We use Windows Authentication, and we have a User table that stores authorized domain users. For our audit tables, we'd like to know which user modified the relationship.

The problem I have is, how do we get the ID from our User table based on the user who updated a relationship using our MVC application? I've looked at some options, and the only thing I can come up with so far, in a trigger, is this:

SQL
SELECT @username = nt_username FROM sys.sysprocesses WHERE spid = @@SPID


That will retrieve my username without the domain, which is what I want. I can then compare it to our User table and get the ID where the username matches. But is this the best way to go about it?
djj55: Nice but may have a permission problem
Pete O'Hanlon: He has my permission to run it.

AnswerRe: Audit Tables for Many-Many Relationships Pin
Eddy Vluggen13-Jan-15 7:49
professionalEddy Vluggen13-Jan-15 7:49 
GeneralRe: Audit Tables for Many-Many Relationships Pin
Matt U.13-Jan-15 10:00
Matt U.13-Jan-15 10:00 
GeneralRe: Audit Tables for Many-Many Relationships Pin
Eddy Vluggen13-Jan-15 12:49
professionalEddy Vluggen13-Jan-15 12:49 
AnswerRe: Audit Tables for Many-Many Relationships Pin
Mycroft Holmes13-Jan-15 11:42
professionalMycroft Holmes13-Jan-15 11:42 
Questionhelp me ..plz share me database Contact.mdf microsoft Pin
Nguyen Jay12-Jan-15 21:16
Nguyen Jay12-Jan-15 21:16 
QuestionRe: help me ..plz share me database Contact.mdf microsoft Pin
ZurdoDev13-Jan-15 5:33
professionalZurdoDev13-Jan-15 5:33 
AnswerRe: help me ..plz share me database Contact.mdf microsoft Pin
Nguyen Jay13-Jan-15 5:40
Nguyen Jay13-Jan-15 5:40 
AnswerRe: help me ..plz share me database Contact.mdf microsoft Pin
ZurdoDev13-Jan-15 5:44
professionalZurdoDev13-Jan-15 5:44 
GeneralRe: help me ..plz share me database Contact.mdf microsoft Pin
Nguyen Jay13-Jan-15 5:53
Nguyen Jay13-Jan-15 5:53 
AnswerRe: help me ..plz share me database Contact.mdf microsoft Pin
ZurdoDev13-Jan-15 6:00
professionalZurdoDev13-Jan-15 6:00 
GeneralRe: help me ..plz share me database Contact.mdf microsoft Pin
Nguyen Jay13-Jan-15 6:03
Nguyen Jay13-Jan-15 6:03 
GeneralRe: help me ..plz share me database Contact.mdf microsoft Pin
ZurdoDev13-Jan-15 6:06
professionalZurdoDev13-Jan-15 6:06 
GeneralRe: help me ..plz share me database Contact.mdf microsoft Pin
Richard Deeming13-Jan-15 6:29
mveRichard Deeming13-Jan-15 6:29 
GeneralRe: help me ..plz share me database Contact.mdf microsoft Pin
Nguyen Jay13-Jan-15 7:17
Nguyen Jay13-Jan-15 7:17 
QuestionMySQL Database Tables Pin
sudevsu12-Jan-15 8:29
sudevsu12-Jan-15 8:29 
AnswerRe: MySQL Database Tables Pin
RUs12313-Jan-15 2:13
RUs12313-Jan-15 2:13 
GeneralRe: MySQL Database Tables Pin
sudevsu14-Jan-15 8:53
sudevsu14-Jan-15 8:53 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.