Home All Groups Group Topic Archive Search About
Author
12 Sep 2006 7:58 PM
mason
Another thought. If OLE DB driver does not provide a parameter for
applications to submit a program identifier, is it possible to set this
information into a system table from an app after the database connection is
established? Thanks.


Show quoteHide quote
"mason" <mason***@msn.com> wrote in message news:...
> Thanks, Aaron.
>
> Those two views do not have client executable names either. I wish the
> native client driver could fill the slot with module name if not provided.
>
>
> Mason
>
>
> "Aaron Bertrand [SQL Server MVP]" <ten.xoc@dnartreb.noraa> wrote in
> message news:uBTrjip1GHA.4300@TK2MSFTNGP03.phx.gbl...
>> That column is only populated if the client chooses to provide it.  But
>> in 2005 you can get a bit more information from these views I think:
>>
>> SELECT * FROM master.sys.dm_exec_connections;
>> SELECT * FROM master.sys.dm_exec_sessions;
>>
>> A
>>
>>
>>
>>
>>
>>
>> "mason" <mason***@msn.com> wrote in message
>> news:OhOAHep1GHA.4176@TK2MSFTNGP06.phx.gbl...
>>>I understand that I can list current connections using the
>>>sys.sysprocesses view in SQL2005; however, the program_name column is
>>>often empty. Is there another way to identify client applications?
>>>Thanks.
>

Author
12 Sep 2006 8:10 PM
Aaron Bertrand [SQL Server MVP]
You cannot (or at least should not) write to system tables.

Create your own table with SPID as a key and update that table when you
connect.  You can always get spid using SELECT @@SPID.

Or why not just change your app's config file(s) to add Application Name to
the connection string.  That seems like a much simpler solution.

A





Show quoteHide quote
> Another thought. If OLE DB driver does not provide a parameter for
> applications to submit a program identifier, is it possible to set this
> information into a system table from an app after the database connection
> is established? Thanks.
Are all your drivers up to date? click for free checkup

Author
12 Sep 2006 8:18 PM
mason
I tried appending "Application Name=" to the end of the connection string
for a PowerBuilder application and it did not show up in the system view. I
think the PB OLE DB driver does not support that option, which is not
documented in PB help.



Show quoteHide quote
"Aaron Bertrand [SQL Server MVP]" <ten.xoc@dnartreb.noraa> wrote in message
news:e28zedq1GHA.3372@TK2MSFTNGP04.phx.gbl...
> You cannot (or at least should not) write to system tables.
>
> Create your own table with SPID as a key and update that table when you
> connect.  You can always get spid using SELECT @@SPID.
>
> Or why not just change your app's config file(s) to add Application Name
> to the connection string.  That seems like a much simpler solution.
>
> A
>
>
>
>
>
>> Another thought. If OLE DB driver does not provide a parameter for
>> applications to submit a program identifier, is it possible to set this
>> information into a system table from an app after the database connection
>> is established? Thanks.
>
>
Author
12 Sep 2006 8:50 PM
Aaron Bertrand [SQL Server MVP]
I'm not familiar with PowerBuilder, so I don't know if it's not supported,
or if it potentially passes it using a different name (application_name,
program_name, program name, who knows what other possibilities exist).

Barring that, if the PowerBuilder app is on a dedicated machine, or is on a
machine shared with apps of different varieties (where all of the other apps
CAN supply application name) then you could tell it apart because it is the
only app without an application_name coming from that IP address or
hostname.

Anyway, updating sysprocesses is not the answer.



Show quoteHide quote
"mason" <mason***@msn.com> wrote in message
news:OlWQviq1GHA.1292@TK2MSFTNGP03.phx.gbl...
>I tried appending "Application Name=" to the end of the connection string
>for a PowerBuilder application and it did not show up in the system view. I
>think the PB OLE DB driver does not support that option, which is not
>documented in PB help.
Author
12 Sep 2006 9:06 PM
mason
Thanks, Aaron.

There are all kinds of PB apps running at client PCs. I tried AppName and
Application Name in the connection string and neither worked.

What I am doing is to get a unique concurrently connected client computer
count (COUNT(DISTINCT host_name)) for licensing enforcement and exclude
certain programs in the process. I was able to do this for Sybase and Oracle
connections without modifying client apps. It's a minor issue. I'll wait for
PB to come up with a new driver that accepts a program identifier.


Show quoteHide quote
"Aaron Bertrand [SQL Server MVP]" <ten.xoc@dnartreb.noraa> wrote in message
news:ur%23a1zq1GHA.4796@TK2MSFTNGP06.phx.gbl...
> I'm not familiar with PowerBuilder, so I don't know if it's not supported,
> or if it potentially passes it using a different name (application_name,
> program_name, program name, who knows what other possibilities exist).
>
> Barring that, if the PowerBuilder app is on a dedicated machine, or is on
> a machine shared with apps of different varieties (where all of the other
> apps CAN supply application name) then you could tell it apart because it
> is the only app without an application_name coming from that IP address or
> hostname.
>
> Anyway, updating sysprocesses is not the answer.
>
>
>
> "mason" <mason***@msn.com> wrote in message
> news:OlWQviq1GHA.1292@TK2MSFTNGP03.phx.gbl...
>>I tried appending "Application Name=" to the end of the connection string
>>for a PowerBuilder application and it did not show up in the system view.
>>I think the PB OLE DB driver does not support that option, which is not
>>documented in PB help.
Author
12 Sep 2006 9:43 PM
Tom Cooper
It's been a while since I used PB very much.  You should be able to do this
(at least you used to be able to do this).  One way would be to use a .udl
file (see http://pbdj.sys-con.com/read/106956_1.htm for an example).

Tom

Show quoteHide quote
"mason" <mason***@msn.com> wrote in message
news:OZK6k9q1GHA.1256@TK2MSFTNGP02.phx.gbl...
> Thanks, Aaron.
>
> There are all kinds of PB apps running at client PCs. I tried AppName and
> Application Name in the connection string and neither worked.
>
> What I am doing is to get a unique concurrently connected client computer
> count (COUNT(DISTINCT host_name)) for licensing enforcement and exclude
> certain programs in the process. I was able to do this for Sybase and
> Oracle connections without modifying client apps. It's a minor issue. I'll
> wait for PB to come up with a new driver that accepts a program
> identifier.
>
>
> "Aaron Bertrand [SQL Server MVP]" <ten.xoc@dnartreb.noraa> wrote in
> message news:ur%23a1zq1GHA.4796@TK2MSFTNGP06.phx.gbl...
>> I'm not familiar with PowerBuilder, so I don't know if it's not
>> supported, or if it potentially passes it using a different name
>> (application_name, program_name, program name, who knows what other
>> possibilities exist).
>>
>> Barring that, if the PowerBuilder app is on a dedicated machine, or is on
>> a machine shared with apps of different varieties (where all of the other
>> apps CAN supply application name) then you could tell it apart because it
>> is the only app without an application_name coming from that IP address
>> or hostname.
>>
>> Anyway, updating sysprocesses is not the answer.
>>
>>
>>
>> "mason" <mason***@msn.com> wrote in message
>> news:OlWQviq1GHA.1292@TK2MSFTNGP03.phx.gbl...
>>>I tried appending "Application Name=" to the end of the connection string
>>>for a PowerBuilder application and it did not show up in the system view.
>>>I think the PB OLE DB driver does not support that option, which is not
>>>documented in PB help.
>
Author
12 Sep 2006 10:40 PM
mason
Thanks, Tom.

The UDL approach works.


Show quoteHide quote
"Tom Cooper" <tomcooper@comcast.no.spam.please.net> wrote in message
news:_KmdnY8y2JeXt5rYnZ2dnUVZ_q-dnZ2d@comcast.com...
> It's been a while since I used PB very much.  You should be able to do
> this (at least you used to be able to do this).  One way would be to use a
> .udl file (see http://pbdj.sys-con.com/read/106956_1.htm for an example).
>
> Tom
>
> "mason" <mason***@msn.com> wrote in message
> news:OZK6k9q1GHA.1256@TK2MSFTNGP02.phx.gbl...
>> Thanks, Aaron.
>>
>> There are all kinds of PB apps running at client PCs. I tried AppName and
>> Application Name in the connection string and neither worked.
>>
>> What I am doing is to get a unique concurrently connected client computer
>> count (COUNT(DISTINCT host_name)) for licensing enforcement and exclude
>> certain programs in the process. I was able to do this for Sybase and
>> Oracle connections without modifying client apps. It's a minor issue.
>> I'll wait for PB to come up with a new driver that accepts a program
>> identifier.
>>
>>
>> "Aaron Bertrand [SQL Server MVP]" <ten.xoc@dnartreb.noraa> wrote in
>> message news:ur%23a1zq1GHA.4796@TK2MSFTNGP06.phx.gbl...
>>> I'm not familiar with PowerBuilder, so I don't know if it's not
>>> supported, or if it potentially passes it using a different name
>>> (application_name, program_name, program name, who knows what other
>>> possibilities exist).
>>>
>>> Barring that, if the PowerBuilder app is on a dedicated machine, or is
>>> on a machine shared with apps of different varieties (where all of the
>>> other apps CAN supply application name) then you could tell it apart
>>> because it is the only app without an application_name coming from that
>>> IP address or hostname.
>>>
>>> Anyway, updating sysprocesses is not the answer.
>>>
>>>
>>>
>>> "mason" <mason***@msn.com> wrote in message
>>> news:OlWQviq1GHA.1292@TK2MSFTNGP03.phx.gbl...
>>>>I tried appending "Application Name=" to the end of the connection
>>>>string for a PowerBuilder application and it did not show up in the
>>>>system view. I think the PB OLE DB driver does not support that option,
>>>>which is not documented in PB help.
>>
>
>

Bookmark and Share