Results 1 to 8 of 8
  1. #1
    Join Date
    Dec 2002
    Location
    Brazil
    Posts
    59

    Unanswered: How can I get the username from an application?

    Hi everybody,

    Here the environment is application in 3 layers.
    So the user in his client machine, access the application in an application server that sends the request to my sql server database server.
    My problem is: when I run sp_who from Query Analyzer, I see the host name that is pre-defined inside code application. But, actually, I need to know the user who is requesting the transactio so I can know right the person who is slowing my database performance....
    Do you know, any function, procedure or anything else that I can use in the application code in order to provide the user or the host name from the client machine?????
    I hope some answers...

    Thank you all,

  2. #2
    Join Date
    Jun 2003
    Location
    Ohio
    Posts
    12,592
    Provided Answers: 1
    Look up NILADIC functions in Books Online.
    If it's not practically useful, then it's practically useless.

    blindman
    www.chess.com: "sqlblindman"
    www.LobsterShot.blogspot.com

  3. #3
    Join Date
    Jul 2003
    Location
    San Antonio, TX
    Posts
    3,662
    host_name()
    "The data in a record depends on the Key to the record, the Whole Key, and
    nothing but the Key, so help me Codd."

  4. #4
    Join Date
    Dec 2002
    Location
    Brazil
    Posts
    59

    Aplying SP 3

    Hi all,

    I have this doubt: may I apply SP3a in my SQL Server production database while it is operational?
    I mean, may I do this version upgrade while the databases are online and users continue accessing the databases normally?
    My actual version is 8.00.194 (no SP applied), and I am planning to apply SP3a.

    Thank you in advance,
    Nadia

  5. #5
    Join Date
    Feb 2004
    Location
    In front of the computer
    Posts
    15,579
    Provided Answers: 54
    No, when applying sp3a to a server that is currently at RTM (what you load from the CD) will require a reboot of Windows. There will be a brief service interruption while the machine reboots.

    -PatP

  6. #6
    Join Date
    Feb 2004
    Location
    In front of the computer
    Posts
    15,579
    Provided Answers: 54
    Quote Originally Posted by rdjabarov
    host_name()
    Will host_name() help in a three tier environment? I would expect it to return the name of the middleware server.

    -PatP

  7. #7
    Join Date
    Dec 2002
    Location
    Brazil
    Posts
    59
    So this function host_name() doesn't help me, because I need to see the client host name during sp_who....
    Does someone can explain a solution for this?

    Thanks,
    Nadia

  8. #8
    Join Date
    Feb 2004
    Location
    In front of the computer
    Posts
    15,579
    Provided Answers: 54
    The easiest way is to have your middleware set the hostname equal to however it identifies the caller (user name, account number, etc). There are other ways to do this, but they get ugly very quickly and each solution is VERY specific to the installation/application involved.

    -PatP

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •