Click here to Skip to main content
15,791,740 members
Home / Discussions / Database
   

Database

 
AnswerRe: Isolation Level Pin
Eddy Vluggen14-Jan-15 0:44
professionalEddy Vluggen14-Jan-15 0:44 
GeneralRe: Isolation Level Pin
Member 1137363814-Jan-15 1:30
Member 1137363814-Jan-15 1:30 
GeneralRe: Isolation Level Pin
Eddy Vluggen14-Jan-15 3:56
professionalEddy Vluggen14-Jan-15 3:56 
GeneralRe: Isolation Level Pin
Member 1137363814-Jan-15 17:57
Member 1137363814-Jan-15 17:57 
AnswerRe: Isolation Level Pin
Eddy Vluggen15-Jan-15 10:56
professionalEddy Vluggen15-Jan-15 10:56 
GeneralRe: Isolation Level Pin
Member 1137363815-Jan-15 18:15
Member 1137363815-Jan-15 18:15 
GeneralRe: Isolation Level Pin
Eddy Vluggen16-Jan-15 8:58
professionalEddy Vluggen16-Jan-15 8:58 
QuestionAudit Tables for Many-Many Relationships Pin
Matt U.13-Jan-15 4:40
Matt U.13-Jan-15 4: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 8:49
professionalEddy Vluggen13-Jan-15 8:49 
GeneralRe: Audit Tables for Many-Many Relationships Pin
Matt U.13-Jan-15 11:00
Matt U.13-Jan-15 11:00 
GeneralRe: Audit Tables for Many-Many Relationships Pin
Eddy Vluggen13-Jan-15 13:49
professionalEddy Vluggen13-Jan-15 13:49 
AnswerRe: Audit Tables for Many-Many Relationships Pin
Mycroft Holmes13-Jan-15 12:42
professionalMycroft Holmes13-Jan-15 12:42 
Questionhelp me ..plz share me database Contact.mdf microsoft Pin
Nguyen Jay12-Jan-15 22:16
Nguyen Jay12-Jan-15 22:16 
QuestionRe: help me ..plz share me database Contact.mdf microsoft Pin
ZurdoDev13-Jan-15 6:33
professionalZurdoDev13-Jan-15 6:33 
AnswerRe: help me ..plz share me database Contact.mdf microsoft Pin
Nguyen Jay13-Jan-15 6:40
Nguyen Jay13-Jan-15 6:40 
AnswerRe: help me ..plz share me database Contact.mdf microsoft Pin
ZurdoDev13-Jan-15 6:44
professionalZurdoDev13-Jan-15 6:44 
GeneralRe: help me ..plz share me database Contact.mdf microsoft Pin
Nguyen Jay13-Jan-15 6:53
Nguyen Jay13-Jan-15 6:53 
AnswerRe: help me ..plz share me database Contact.mdf microsoft Pin
ZurdoDev13-Jan-15 7:00
professionalZurdoDev13-Jan-15 7:00 
GeneralRe: help me ..plz share me database Contact.mdf microsoft Pin
Nguyen Jay13-Jan-15 7:03
Nguyen Jay13-Jan-15 7:03 
GeneralRe: help me ..plz share me database Contact.mdf microsoft Pin
ZurdoDev13-Jan-15 7:06
professionalZurdoDev13-Jan-15 7:06 
GeneralRe: help me ..plz share me database Contact.mdf microsoft Pin
Richard Deeming13-Jan-15 7:29
mveRichard Deeming13-Jan-15 7:29 
GeneralRe: help me ..plz share me database Contact.mdf microsoft Pin
Nguyen Jay13-Jan-15 8:17
Nguyen Jay13-Jan-15 8:17 
QuestionMySQL Database Tables Pin
sudevsu12-Jan-15 9:29
sudevsu12-Jan-15 9:29 
AnswerRe: MySQL Database Tables Pin
RUs12313-Jan-15 3:13
RUs12313-Jan-15 3:13 
GeneralRe: MySQL Database Tables Pin
sudevsu14-Jan-15 9:53
sudevsu14-Jan-15 9: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.