Solved

get connection Information for logging in an update trigger

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

Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Sql Data via Excel--performance issues 2 56
CONVERT date time to a different time zone. 2 63
SQL Restore Script - Syntax Error 8 104
convert null in sql server 12 48
I am showing a way to read/import the excel data in table using SQL server 2005... Suppose there is an Excel file "Book1" at location "C:\temp" with column "First Name" and "Last Name". Now to import this Excel data into the table, we will use…
INTRODUCTION: While tying your database objects into builds and your enterprise source control system takes a third-party product (like Visual Studio Database Edition or Red-Gate's SQL Source Control), you can achieve some protection using a sing…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

821 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