HOST_NAME

  • can anyone tell me how HOST_NAME is resolved on SQLServer - it seems to be inconsistent at times.

    Does anyone know where the SQL Server HOST_NAME function gets its information? Could it be a configurable parameter in the front end application that is passed in the connect string?

    Brian Lockwood
    President
    ApexSQL - SQL Developer Essentials

    http://www.apexsql.com/blog

    Stand up for an Independent SQL Community - be Informed

  • Host_Name()? Or App_Name()?

    Andy

  • Should be provided by the client as an optional OLEDB parameter.

    Steve Jones

    steve@dkranch.net

  • Which one are YOU talking about Steve?

    Andy

  • Both should be provided by the client. QA will provide those to the server on connection. That's why you often see very little information from sp_who2 when a web app connects. Not many people fill in all the connection parameters.

    I'm not sure about ADO, RDO, OLEDB. They may provide defaults based on the account executing the call.

    Steve Jones

    steve@dkranch.net

  • I'll have to look. I know for sure you can set the application name in an ADO connect string, but I don't remember seeing anything for the host. On the other hand, I do remember seeing the computer name in DAO connect strings.

    Andy

  • quote:


    Host_Name()? Or App_Name()?

    Andy


    Host_Name()

    Here is the complete text of question posted to my support site

    "I purchased a copy of Auto Audit for a client's server. They are using SQL server 7.0 SP3 with domain security.

    The product seems to work fine, except the host names are not correctly resolved. As an example, I have a computer named "123" which I use to change data. For the last day or so, all changes are logged from computer "123" even if other computers are used. Interesting enough, the change data and the user name are correctly listed.

    I know this may be an issue with the SQL server providing an incorrect host name to the script, which in turn dumps it into the audit table. I can't remember off the top of my head, but I'm pretty sure the network where this is happening does not have DNS names assigned for the computers. In other words, the SQL server probably uses that wanky MS netbios to "resolve" the name of the computer.

    Has anyone else seen this problem?"

    Brian Lockwood
    President
    ApexSQL - SQL Developer Essentials

    http://www.apexsql.com/blog

    Stand up for an Independent SQL Community - be Informed

  • quote:


    Host_Name()? Or App_Name()?

    Andy


    here is another post from my site related to Host_Name()

    "I have also seen the same problem. We're using MS Access as the front end. The host name that is stored is that of another user of the Access application. If I create a new Access application, link to the table and make a change to a record the host name is correct.

    Does anyone know where the SQL Server HOST_NAME function gets its information? Could it be a configurable parameter in the front end application that is passed in the connect string?

    Thanks"

    Brian Lockwood
    President
    ApexSQL - SQL Developer Essentials

    http://www.apexsql.com/blog

    Stand up for an Independent SQL Community - be Informed

  • I'd have to look to find the table name, but I KNOW Access stores the workstation ID for linked tables in a system table. I'll try to find time to find the table!

    Andy

  • We've had a similar problem trying to see who is actually connecting to the database. It seems that Access stores the original creator of the database somewhere and any one that uses that database shows up as the creator's name in the hostname column. The mac address is how we determined who was the actual user was. I used a network tool to bring me back the mac address and user names of all of the people on the network, I put that into a table and joined it on net_address from the sysprocesses table.

    If you need more let me know. I don't know why it happens like that with access, all I know is that a former employee that create 100's of access db's routinely shows up as connected to the sqlserver even though just the databases are being used.

    Tom Goltl

  • quote:


    We've had a similar problem trying to see who is actually connecting to the database. It seems that Access stores the original creator of the database somewhere and any one that uses that database shows up as the creator's name in the hostname column. The mac address is how we determined who was the actual user was. I used a network tool to bring me back the mac address and user names of all of the people on the network, I put that into a table and joined it on net_address from the sysprocesses table.

    If you need more let me know. I don't know why it happens like that with access, all I know is that a former employee that create 100's of access db's routinely shows up as connected to the sqlserver even though just the databases are being used.

    Tom Goltl


    thx - this is good info

    Brian Lockwood

    President

    LockwoodTech Software

    Brian Lockwood
    President
    ApexSQL - SQL Developer Essentials

    http://www.apexsql.com/blog

    Stand up for an Independent SQL Community - be Informed

Viewing 11 posts - 1 through 10 (of 10 total)

You must be logged in to reply to this topic. Login to reply