Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Program_name in sysprocesses

Status
Not open for further replies.

TalentedFool

Programmer
Jul 23, 2001
214
GB

I'm using a bog standard SQLServer ODBC to connect to SQL with for my program. Problem I have is that it isn't passing through my Program name to the app and so the program_name in sysprocesses is not filled.

anybody know of a way to update the program_name field on sysprocesses after the connection to the DB has been established? I know it's a 'virtual' table but this really would be handy for me.



~ Remember - Nothing is Fool Proof to a Talented Fool ~
 
No but you can create another table which has the spid, logon time and program name and add the row to that then join on the other two fieds to get it.

======================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
 

So how can I get the ODBC to pass through the APP name when we connect? Or do we need to use a different ODBC driver?

Thanks for the suggestion though

~ Remember - Nothing is Fool Proof to a Talented Fool ~
 
If I remember correctly you can specify the application name as part of the connection string, I cannot remeber the syntax but a quick search on connection strings will produce an answer.

-- Gavin
 

Gavin

Thanks for that - I alreayd know aboutt he connection string. Trouble is, as my software is client server, the client needs to use a defined ODBC driver and not the connection string. Really do wish it was that simple

Thanks anyway. I'll keep looking at different solutions

~ Remember - Nothing is Fool Proof to a Talented Fool ~
 
The only way I know to get the application name into SQL is as part of the connection string, and certainly that is what Books Online and MSDN tell you about the application name.
You say you have to use a defined ODBC driver, when you specify this driver is there no option to add additional connection string information?
How exactly are you connection to SQL? A snippet of code may be useful.

-- Gavin
 

The connection the SQL database is done for us. We're using a 4GL RAD language to create our app - we only need to supply it with a dbname in a config file - when a client connects to the server - that then goes away and checks for an ODBC connection on the server for the connection to the SQL DB. We're currently using the SQLServer standard ODBC - not very good I know, but nothing we can do about it :-(

That's why I was hoping to be able to update the sysprocesses on the fly so that I could write away some details about the connection by the client.

Looks like I'm going to have to drag back some info from sysprocesses for each client and write them away to my own table. Means a bit more work but better I suppose in the long run.

Cheers anyway

~ Remember - Nothing is Fool Proof to a Talented Fool ~
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top