I'm a bit new til ms sql server and hope that anyone here can answer a
question I have. I'm running a ms sql server 7.0. The server is
accessed by a application written in Access (help..) and sometimes I
experience that the server performance is slowing down. When I do a
sp_who I find alot of the processes (or sids) with the status
sleeping? Can anyone please tell med what this means, and is it ok for
me to kill these processes? Since this is happening quite often I
would like to make a script that automatically kills all sleeping
processes, is this ok?
Looking forward to hearing from anyone!
The column waittype of master..sysprocesses table contains binary numbers. I am looking for their codes. I know that Microsoft has published these codes for SQL Server 7 (here: http://support.microsoft.com/default.aspx?scid=kb;EN-US;244455 ), but I need the codes of SQL Server 2000.
And yes, I've checked spt_values - they are not there.
My application was written in SQL 2000 where a non-dbo account could see all logged in users. Is there some way I can do this in SQL 2005? Here is the query I run in SQL 2000: SELECT spid FROM master.dbo.sysprocesses, master.dbo.syslogins WHERE master.dbo.sysprocesses.sid = master.dbo.syslogins.sid AND master.dbo.sysprocesses.dbid = db_id() AND LOWER(master.dbo.syslogins.name) IN ('grnl_security','log_security')
Right now, my application (where many users log in with gnrl_security) can only see thier own SPID; but I need to see all logged on SPIDS.
I have tried adding a SELECT permission to the new sysprocesses view for user grnl_security.
On SQL Server 6.5, we tried to track down the owner of a process,which was hogging the CPU. Using Currently Activity Detail, we went to the hostname that seemed to be the culprit, but the users had not accessed SQL Server in a few days. Where is SQL Server get the hostname from? We are on an NT4.0 network, using DHCP.
I'm doing an update on a table with about 113m rows, the update-statement is fairly simple: update tab set col = null where col is not null. The col column is mostly null.
Sysprocesses shows three rows for this statement: 1 CXPACKET (its a dual processor, 2000 box with sp3 installed), 2 PAGEIOLATCH_SH (waitresource is filled). My guess would be that the where-clause is executed in a seperate process blocking the update.
I changed the statement into update [...] set col = null; sysprocesses shows one row with PAGEIOLATCH_SH. Executing forever.
I checked other processes including those outside sqlserver but none are using the db, let alone accessing the table involved. Even restarted sqlserver to be sure there's no dead process blocking the update. Didn't help.
So I added a search condition to the where-clause, involving a clustered index in order to reduce the rowcount. The execution plan shows a 97% hit on the clustered index, but sysprocesses shows the three rows again...
So far the profiler didn't help me out either: there's a SP: CacheInsert on the update-statement... then nothing.
ok, I have a requirement where I need to get a list of sql commands currently being blocked. This is very easy to do via stored procedure, and I have it working well using a vb.net console app to fire it off.
Trouble is, I need to ship it to different offices on an ad hoc basis. I don't want to install a stored procedure on each site because it'll be a one off job and there is not likely to be anyone available who would know how to even install a new sp. So, I thought I'd try and pull back the sql commands via a select statement, joining together sysprocesses and the fn_get_sql udf. This returns a table, so I presumed I could join the two together using a subquery via the sql_handle with something like this :
SELECT sql_handle, ( SELECT top 1 [text] FROM ::fn_get_sql(sysprocesses.sql_handle) ) as sqlcommand
FROM master..sysprocesses
The error back is incorrect syntax near 'sysprocesses'. I can't see if I'm doing anything obvious wrong.
We have written various applications that have a connection table for managing users logins, we have a connect stored proc that inserts the SIPD and the login time from sysprocesses.
From time to time we clean up our connections table by queryng against the SPID and login_time in sysprocesses and clear it if these don't match. This has been fine for a few years, howver we have found recently with a client that with some SPID's in sysprocesses that SQL server is changing the login time, this is unexpected behaviour.
The client is using SQL server 2005 and this has caused us problems, we have worked around it for now but wondered if anyone new why on this particular setup why the login time would change even though they have not disconnected.
We have other clients using SQL 2005 but have never seen this issue before, I wondered if there was a setting we have not seen that can cause this.
I was trying to find the bottle neck on our server while we wererunning a couple very large updates.I ran the following query and noticed there were a couple sleepingspid's that were really eating up the memory. One had a value of16000.I guess my question is was this query still holding on to that memoryeven though the query had finished? Why didn't SQL Server clean it up?select spid,substring(Loginame,1,10) Login,memusage,substring(hostname,1,15) Host,program_name,cmd,statusfrom master..sysprocessesorder by memusage desc
In SQL Server 2000 you can monitor active processes by looking at the sql_handle column in sysprocesses. In SQL Server 2005 BOL says sql_handle ...
Represents the currently executing batch or object.
In SQL 2000 a non-zero value in sql_handle indicated an active process. You could not simply rely on the status column to check for an actively running process. This is not the case in 2005. I ran a profiler trace to confirm that just because sql_handle reports a non-zero value does not mean the corresponding process is active. Does anyone know why this has changed and how we are now to interpret sql_handle in 2005? Why are non-zero entries reported for processes that are not currently running?
I am trying to find a select on sysprocesses that would list all the activelogins. An active login is a login that has a TSQL statment being executedon the server,This didnt work to well! Any ideas. Thanks in advance.select sp.loginame,-- more columnsfrom master..sysprocesses spwhere sp.status not in ('sleeping','background' )order by 1
Does anyone knows how the field NET_ADDRESS in the master.dbo.sysprocesses table is encoded ? May I extract the IP address or MAC address from that field ?
Guys, I need to send a group of people a list of specific processes running on the server, one of the requirements is to send them what's actually being ran on the machine. I have the information I was on the sysprocess tabke and the results of the DBCC Inputbuffer. Is there a way to link both result sets?
This is the criteria of the processes that neeed to be sent out to my users:
SELECT * FROM master.dbo.sysprocesses p WHERE last_batch < DATEADD(mi, -5, GETDATE()) AND dbo.fncGetNumLocks(p.spid, DB_ID('EngDataMart')) > 1 GROUP BY p.spid, p.loginame, p.hostname, dbo.fncGetNumLocks(p.spid, db_id('DBName')) ORDER BY p.spid