Drop Table

Support Forum for database administrators and web based access to important newsgroups related to databases
Register on Database Support Forum Edit your profileCalendarFind other Database Support forum membersFrequently Asked QuestionsSearch this forum -> 
For Database admins: Free Database-related Magazines Now Free shipping to Texas


Post New Thread










Thread
Author

SQL 2005, @@SPID and sysprocess table(view) access
Hi,

Used to have next functionality in SQL 2000 and earlier:
application signals some data locking to others by storing some Id,
connection @@SPID and current time in in some, lets say, Locks user table.
And deletes the record when done. Other processes may check the record and i
f
exists - have to validate it (may be just some garbage from broken
connections).
Validation happened by checking stored in Locks SPID against those in
sysprocesses. Record considered as garbage if the SPID is not in sysprocesse
s
now or connected after time, registered in Locks (means it just reused by
some newer connection).
Above was working fine because in SQL2000 and earlier everybody could see
all records in sysprocesses. In 2005 user can see only his own record (unles
s
he is member of processadmin server role). Also my users working under
Application Role, so I cannot give them processadmin even if I want to. So
the question is:

How to get access to all records in sysprocesses for simple
user, working under Application Role?

Please note, SPs with EXECUTE AS clause do not work for the case.
Also all above is true for sys.dm_exec_sessions and  sys.dm_exec_requests
views.

Thanks.


Report this thread to moderator Post Follow-up to this message
Old Post
Dweller
09-29-05 01:23 AM


Re: SQL 2005, @@SPID and sysprocess table(view) access
Have you tried

GRANT VIEW SERVER STATE TO user

Tim S


Report this thread to moderator Post Follow-up to this message
Old Post
Tim
09-29-05 01:23 AM


Re: SQL 2005, @@SPID and sysprocess table(view) access
> Have you  tried

> GRANT VIEW SERVER STATE TO user

Yes I did. Problem is my users work from under Application Role, so the
right is gone as soon as SP_SETAPPROLE is called.

Any other idea? Basically I need to detect somehow that some particular
connection is still alive. May be you know other ways?

Thanks.





Report this thread to moderator Post Follow-up to this message
Old Post
Dweller
09-29-05 06:23 PM


Sponsored Links





Last Thread Next Thread
Post New Thread

MS SQL Server archive

Show a Printable Version Email This Page to Someone! Receive updates to this thread
Microsoft SQL Server
Access database support
PostgreSQL Replication
SQL Server ODBC
FoxPro Support
PostgreSQL pgAdmin
SQL Server Clustering
MySQL ODBC
Web Applications with dBASE
SQL Server CE
MySQL++
Sybase Database Support
MS SQL Full Text Search
PostgreSQL Administration
SQL Anywhere support
DB2 UDB Database
Paradox Database Support
Filemaker Database
Berkley DB
SQL 2000/2000i database
ASE Database
Forum Jump:
All times are GMT. The time now is 02:28 PM.

 
Mobile devices forum | Database support forum archive




Copyrights DropTable.com Database Support Forum 2004 - 2006