Solved

get connection Information for logging in an update trigger

Posted on 2008-10-17
2
227 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
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

When writing XML code a very difficult part is when we like to remove all the elements or attributes from the XML that have no data. I would like to share a set of recursive MSSQL stored procedures that I have made to remove those elements from …
In this article I will describe the Copy Database Wizard method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

895 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now