Solved

get connection Information for logging in an update trigger

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

Complete Microsoft Windows PC® & Mac Backup

Backup and recovery solutions to protect all your PCs & Mac– on-premises or in remote locations. Acronis backs up entire PC or Mac with patented reliable disk imaging technology and you will be able to restore workstations to a new, dissimilar hardware in minutes.

Join & Write a Comment

If you having speed problem in loading SQL Server Management Studio, try to uncheck these options in your internet browser (IE -> Internet Options / Advanced / Security):    . Check for publisher's certificate revocation    . Check for server ce…
So every once in a while at work I am asked to export data from one table and insert it into another on a different server.  I hate doing this.  There's so many different tables and data types.  Some column data needs quoted and some doesn't.  What …
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

707 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