May 6, 2009 at 5:03 am
Hi,
ideally all web based application use a generic sql authenticated account or a windows authenticated service account to access the sqlserver.
How can we trace the client ipaddress or client username that is attempting to access the database ?
querying sysprocesses would give the generic login detail and the app server host details from where the application runs.
Any input is much appreciated.
Thanks - Nazeer
May 6, 2009 at 8:00 am
I don't know that there is a way to do this in SQL Server as the connection to SQL Server is by the specified user and the Web Server. I would think you would need to find this on the web server.
I've never tried this, but I suppose it might be possible to get the connected computer name and user name in the web application and pass that in the connection string as the Work Station ID parameter of the connection string to SQL Server. Something like this:
Data Source=Server;Initial Catalog=AdventureWorks;User Id=myUsername;Password=myPassword;Workstation ID=[ComputerName & UserName]
Jack Corbett
Consultant - Straight Path Solutions
Check out these links on how to get faster and more accurate answers:
Forum Etiquette: How to post data/code on a forum to get the best help
Need an Answer? Actually, No ... You Need a Question
May 8, 2009 at 5:26 pm
In Asp.net 2.0 and up there are two easy ways to do it either implement Asp.net membership database and run the stored procedures in that database or you use the Asp.net table profile object. I am attaching the table profile white paper and you could go to the location below to run the aspnet_regsql to create the ASPNETDB it comes with tables and stored procedures you can use.
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727
Kind regards,
Gift Peddie
Viewing 3 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply