Using an ALIAS | SQL Server Performance Forums

SQL Server Performance Forum – Threads Archive

Using an ALIAS

A few years back we had an application that would connect using a OLEDB connection string, using the same login. Yet in that connection string we trapped the machine name and passed that along to use as an alias.. So in our example. We have hundreds of users that all authenticate using "App" as the login name. I want to change that so our intranet ap will authenticate using IIS still by using app, but to authenticate to SQL it will pass the machine name(not username) to SQL.. Has anyone done this, and what are the valid parameters in a OLEDB login string..? -David -David Roesch
San Diego, Ca
Interesting approach. May I ask why you have chosen to authenticate based on a machine instead of a user? And how did you look up the machine name before? Did you do a connection with "App", then read the connection properties to get the workstation ID and then you reconnected with that as login name? Anyway, in ASP you need to use Request.ServerVariables("REMOTE_HOST"). This will only give you IP address by default though. You need to configure IIS to perform a reverse DNS lookup to get the machine name. This works best in intranet scenarios and isn’t good for sites with heavy traffic. See the article below on how to enable it in IIS: HOWTO: Configure REMOTE_HOST to Perform a Reverse DNS Lookup in IIS
http://support.microsoft.com/default.aspx?scid=kb;EN-US;245574 Your DNS servers need to be configured to do reverse lookups (IP to name) for this to work. Edit:
About the format for an OLEDB string check outhttp://www.connectionstrings.com . Do a standard OLEDB connection and then loop trough your connection properties and print them out to see all parameters. /Argyle
Hi, <img src=’/community/emoticons/emotion-1.gif’ alt=’:)‘ /><br /><br />Well we are a call center, adn therefore have at times a high turnover with staff. And to help with not having to constantly change usernames, I thought it would be best to have the station numbers which are constant be the login names. IE: STN-45. It is a intranet application, with OLEDB connection string. <br /><br />As it stands now, we have no way to determine who as made what change to tables, as everyone logs in using the "App" login. So if we can capture the machine name and pass that as a login name to SQL that would then start stamping the SQL records with a more traceable value. <br /><br />Do you think that article covers what we are trying to do..?<br /><br />-David<br /><br /><br />-David Roesch<br />San Diego, Ca
I see. Yes the article covers what you need to do. Using REMOTE_HOST is the only way for IIS to identify a remote machine name. /Argyle
]]>