Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Detect active users at SQL Server
Message
 
À
14/11/2011 11:38:44
Metin Emre
Ozcom Bilgisayar Ltd.
Istanbul, Turquie
Information générale
Forum:
Visual FoxPro
Catégorie:
Client/serveur
Versions des environnements
Visual FoxPro:
VFP 9 SP2
Database:
MS SQL Server
Divers
Thread ID:
01528779
Message ID:
01528850
Vues:
59
>>>>>Hi All,
>>>>>
>>>>>I developed a copy-protect method with some utitilies from UT and other VFP sources. It looks cpu, hdd serial etc...
>>>>>I was use .dbf file and lock one record for each user when developing .dbf based applications for RDP users.
>>>>>How can I control active user counts at SQL Server?
>>>>
>>>>With sufficient permissions (VIEW SERVER STATE specifically), you can work with the sp_who stored procedure.. http://msdn.microsoft.com/en-us/library/ms174313.aspx
>>>>
>>>>make sure you give your application a name in the connection string by the way - makes this much easier to filter!
>>>
>>>Thank you,
>>>
>>>That's excellent!.. How can I add my application name at connection string?
>>
>>See http://blog.benhall.me.uk/2007/10/sql-connection-application-name.html
>>
>>BTW, you can also check sp_who2 or sp_WhoIsActive stored procedure by Adam Machanic that provides more useful info.
>
>Application name is "Microsoft Visual Foxpro" and I cannot change it with connection string. And there is another problem there are six rows seem just for one application. I just created one handle. Why?

Remember that SQL requests are stateless. An application may make a bunch of individual SQL queries very quickly, and all will be individual processes to the SQL server.

Note: there is also an undocumented sp_who2 procedure that returns more information - you may be able to group and filter easier with that.

You should be able to set your application name in the sqlconnection. Can you post your connection string you are using?
____________________________________

Don't Tread on Me

Overthrow the federal government NOW!
____________________________________
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform