April 12, 2005 at 2:25 pm
on SQL 7 database server, is there a way that I can track back to the host (mostly web servers) and find out which host is connecting to a particualar database?
April 12, 2005 at 2:36 pm
Unfortunately, unless you are passing in the Environ$("COMPUTERNAME") in as a parameter and logging it to an audit table sp_who2 will only show the web server due to connection sharing....
Good Hunting!
AJ Ahrens
webmaster@kritter.net
April 12, 2005 at 2:49 pm
Thanks for reply my question so quick! I am using SQL EM and checking current activity, some with their hostname listed but some don't! I am wandering how I can configure that to make them all show the hostname?
April 12, 2005 at 3:03 pm
He meant that the client application has to be coded in such a way as to provide it (hostname) when logging in. If the client app doesn't provide it, you don't get it. The standard apps SQL QA, EM, etc. are coded to provide it.
April 12, 2005 at 3:12 pm
Thanks!
April 13, 2005 at 2:23 am
My VB6 application connecting through ADO puts 'Visual Basic' in the Program Name column. Can anyone suggest as to how to make this more informative?
April 13, 2005 at 2:31 am
In your connection string, add "Application Name=app_name;"
April 13, 2005 at 4:15 am
Easy when you know how! Many thanks.
April 13, 2005 at 4:59 am
http://www.connectionstrings.com/ is a great resource.
April 13, 2005 at 2:10 pm
You can't. One of the flaws with the hostname in SQL Server 7 and 2000 with the sysprocesses table and the stored procedures that derive from it (sp_who and sp_who2) is that SQL Server trusts the client when it tells SQL Server what its hostname is. Meaning if it doesn't pass the hostname you get nothing and worse, if it decides to pass a spoofed hostname, you get the spoofed name, which doesn't do you any good. Short of dropping down to the network layer, this is as good as it gets with SQL Server right now.
K. Brian Kelley
@kbriankelley
Viewing 10 posts - 1 through 9 (of 9 total)
You must be logged in to reply to this topic. Login to reply