Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Old Forums
 CLOSED - General SQL Server
 Unique workstation/client ID in web application ?

Author  Topic 

gispro
Starting Member

21 Posts

Posted - 2006-01-25 : 08:41:38
Whenever I'm working with MS/SQL in a desktop environment, I can use the HOST_NAME() function to let the server know which workstation is accessing the database.

However, when I try to use it in a web application - as in Reporting Server - the HOST_NAME() yields the server name, not the workstation name - which makes sense but doesn't help me. This is even true when the web application runs under Integrated Security, as RP does.

I've tried to look into almost all the system variables available, but they typically yield "dbo", "sa" or even ".Net SqlClient Data Provider". Nothing unique at least.

Is there any way to have the SQL Server know which workstation is accessing it thru a web application ?

I need it to coordinate multi-user access to a common report/solution (in RP). Other suggestions to that end are highly appriciated as well.

--
GisPro

gispro
Starting Member

21 Posts

Posted - 2006-01-25 : 10:06:17
Further to my post above, I've continued experimenting with various functions and variables.

It seems that the SERVERPROPERTY() function with both parameters "servername" and "machinename" will return my workstation name !?

It seems to be somewhat unreasonable, it being a "server" related function, but I'm definitely happy as long as it work. Howeever, if anyone can offer a good explanation for this strange behaviour, I'll be happy to hear it :-)


--
GisPro
Go to Top of Page

gispro
Starting Member

21 Posts

Posted - 2006-01-25 : 12:15:44
Ah, a little premature. My intricate setup got the better of me :-(

Initially, PC1 called RepSvcs on PC3, that used the SQL Server on PC1. When I exchanged PC1 for PC2 as client, SERVERPROPERTY still returned PC1. So it seems I mistook the PC1 for meaning client, not backend database server. Which explains the behaviour, that now makes complete sense.

I keep looking.

--
GisPro
Go to Top of Page

gispro
Starting Member

21 Posts

Posted - 2006-02-07 : 05:53:41
Ok, case closed. We ended up using another setup under which the client ID was unnecessary.

--
GisPro
Go to Top of Page
   

- Advertisement -