Solved

get connection Information for logging in an update trigger

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

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

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

Use this article to create a batch file to backup a Microsoft SQL Server database to a Windows folder.  The folder can be on the local hard drive or on a network share.  This batch file will query the SQL server to get the current date & time and wi…
In this article we will get to know that how can we recover deleted data if it happens accidently. We really can recover deleted rows if we know the time when data is deleted by using the transaction log.
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

810 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