Solved

get connection Information for logging in an update trigger

Posted on 2008-10-17
2
230 Views
Last Modified: 2012-05-05
I need to know how to get the id of the user that is updating some fields in my SQL Server 2005 database. I have set update triggers for the fields and I'm getting good logs of the values and when they are changing, but I'm wondering if there is a way to get the user connection string information that is connected to the database running the updates.

I understand that the application that uses this DB would show up for almost all updates, but there are other process external to the application, and those are the ones I'm trying to pin point because one of them is not updating the fields correctly.

I know this can be done in Oracle, but I couldn't find anything on SQL Server 2005.

Many Thanks!
0
Comment
Question by:asmyatt
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 39

Accepted Solution

by:
BrandonGalderisi earned 500 total points
ID: 22748887
Are you talking about your application user_id or the database user_id.

If SQL login info, these are some fields.

select user_id(),user_name(),system_user
0
 
LVL 2

Author Closing Comment

by:asmyatt
ID: 31507307
select user_id(),user_name(),system_user

that's what I needed.

Thanks!
0

Featured Post

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article will describe one method to parse a delimited string into a table of data.   Why would I do that you ask?  Let's say that you need to pass multiple parameters into a stored procedure to search for.  For our sake, we'll say that we wa…
by Mark Wills Attending one of Rob Farley's seminars the other day, I heard the phrase "The Accidental DBA" and fell in love with it. It got me thinking about the plight of the newcomer to SQL Server...  So if you are the accidental DBA, or, simp…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…
Finding and deleting duplicate (picture) files can be a time consuming task. My wife and I, our three kids and their families all share one dilemma: Managing our pictures. Between desktops, laptops, phones, tablets, and cameras; over the last decade…

751 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question