Disconnect A User Whoz Locking The DB With Diff SPIDs
Jun 1, 2004
I have issued a simple insert statement on table and the statement could not insert a single row into the table.When i check the locks on the tables i found that almost 5000(five thousand) locks on the table for a single user with different SPID(s).
The user is and sql server user(not a windows user) and used to connect to the application.I wanted to disconnect the user from the DB so that all the locks will be freed.But i dunno how to disconnect a user from the DB. I know that i can issue KILL command to Terminate a user process based on the system process ID,but here the same user has nearly 1000 SPIDs.I thought that it would be very big job to kill each and every process and restared the sql server.but i guess its not the correct process to do.
how can i dosconnect a specific user from the DB.
Thanks.
View 1 Replies
ADVERTISEMENT
Nov 10, 2003
A fellow developer of mine has created a ASP.Net application that executes some fairly complex stored procedures. This application is for all intensive purposes a queue and 3 or 4 people work on processing items in a FIFO type environment. There is logic in the Stored procedures to make sure each worker get a unique entry using a series of query hints.
Well what we are seeing is if these works are moving at a rapid pace and we execute an sp_who2 on the sql server there are entries that that seems to be hanging there and REMAINING there even after a browser is closed or the disposed method has been called on the connection object. Has anyone else experienced something similar to this with an ASP.Net application used by mutiple people?
My inclination is to blame the design of the application, but before I do that and step on my co-workers toes I thought I would throw this out to the group.
Thanks in advance for your input.
View 7 Replies
View Related
Jun 28, 2004
I'm trying to detach my database.But i couldn't do that coz there are some users connected to it. So how can i disconnect them?is there any way to disconnect them from the DB?
Thanks.
View 2 Replies
View Related
May 22, 2001
I have an issue with a server where some users are recieving error messages along the lines of "There are currently 250 connected users etc....". the result of which is that the users sometimes can't connect. The server properties have Current Users set to 250 - I know that I could increase this figure but that doesnt't appear to be the problem.
It would seem that connections appear to stay connected even though the user has finished any server/client transactions. Also there seems to be a huge number of SPIDs even when there are only a handfull of users. Most of the 'Process Details' for these user threads show the following: "IF @@TRANCOUNT > 0 COMMIT TRAN".
What is going on and why are these Process IDs hanging around, sometimes the only option is to reboot the client PCs since trying to kill the processes just makes them reappear a few seconds later?
It could be the 32-bit client application causing it, but these problems are only on one server out of half a dozen.
Any ideas?
Thanks, Derek.
View 2 Replies
View Related
Jun 19, 2008
Hi to all, Can any body tell me what is the difference between Stored procedures and User Defined Functions ? In my assumption Function return a value or table, but SP doesn't return value instead of that SP use select statement or assign value to output statement. This is right?
View 3 Replies
View Related
Feb 12, 1999
I need to write a 'select' statement to fetch data from different tables, which are located on different servers.
Can any one help in writing this 'select' statement with out moving the tables on to same server.
Thanks in Advance.
Murali Raparla.
View 2 Replies
View Related
Nov 13, 2007
is there any way to get all the SPID's running a particular Stored Proc?
Thx
Venu
View 3 Replies
View Related
Feb 22, 2001
We have just combined 3 sites into one server.
Two of the sites are serving fine, however one site has spids
that won't disconnect. By the end of the day there are over 600 spids
from that one site. At first we thought it was due to the ASP pages
had a db connect, but nothing that closed that db connection. But after
they modified the pages, we are still having the same problem. Checked
the webserver and they are identical to the other webservers.
Any ideas???
View 1 Replies
View Related
Jan 24, 2008
A developer came over and asked me a couple of things
1. Can C# not cleanup SPIDs and just open new ones lieing around
2. Do a large number of spids, even if they are sleeping, cause performance issues?
3. What's the Max # of spids sql server can handle?
BOL ain't too helpful right now
View 14 Replies
View Related
Jul 23, 2005
SQL Server 2000Just curious - was wondering why some SPIDS are left hanging out therefor up to several weeks. There are no errors or anything. It looks likenormal processing.Thanks,Craig
View 1 Replies
View Related
Mar 21, 2001
Does anybody have a job where it will disconnect certain users from the database
What I would like to do is schedule a job that will run at 11:00pm that will disconnect certain users (not all of them). This program should also kill any jobs that these users may be running.
I running into a problem occasionally, where a certain program hangs up and will not release its DB locks. This then keeps a couple of the nightly batch jobs from running.
(I run on SQL SERVER 7.0 on a NT server)
Matt Atkinson, mratkinson@www.com
View 2 Replies
View Related
Jun 28, 2004
Is there a way to forcibly disconnect users from a db with t-sql? I'm doing a nightly restore of a db and users who shouldnt remain connected after hours, are. So I cannot restore the db unless I disconnect them as the db cannot be obtained for exclusive access.
Any thoughts on this?
Edward Hunter, Data Application Engineer
comScore Networks
View 3 Replies
View Related
Oct 12, 2007
Dear All,
i've to drop one database....i'm sure....
but it is saying presently it is in use....
there no no replication....
some user is using....
that is a new database.....how can i throw all users from the database
Vinod
Even you learn 1%, Learn it with 100% confidence.
View 4 Replies
View Related
Nov 5, 2007
Running server 2003. I am running a program from home and am telneting in. When I leave for over 1/2 hour without inputting anything it disconnects me. How can I reset this setting to several hours befor it will disconnect me?
View 1 Replies
View Related
Oct 19, 2005
Hey guys,
I've recently noticed some strange behaviour with sql server 2000 spid's blocking themselves. The spid will appear to be blocked for short periods of time, and then the block will disappear. I'm not sure how this could occur. It started appearing around the same time as I applied SP4.
If anyone could provide any insight into this, it would be greatly appreciated.
Cheers,
-Kilka
View 7 Replies
View Related
Jul 20, 2005
We are using Merge replication with clients from remote offices (SQL2000, sp3). Recently, I have had a problem with users who arereplicating, and they shut down their laptops. The connection neverdies, and I end up with major blocking issues related to the"orphaned" spid. The tables that are blocked are used to filter dataon each client. Since the orphaned spid is blocking, backups will runforever, and have to be killed, and a SQL management job thatinserts/updates data in these tables has to be killed.If I kill the spid, it shows a rollback at 0% and the status neverchanges. The user has disconnected, and there is really nothing toroll back. How can I get rid of this spid with out restarting SQLserver, or rebooting my server?Any help would be greatly appreciated.Thanks,Amy M
View 1 Replies
View Related
Jan 24, 2008
Hi,
The myComplexProc stored proc does the following in sequence:
1. Call a UDF
2. Call another Stored Proc
3. Make a SELECT with 4 joins
4. Make another SELECT 4 joins + aggregate.
Question1: if myComplexProc is executed on 4-CPUs SQL2K Server, does it start and complete with a single SPID?
Question2: Is SQL2K smart enough to do some sort of parallelism behind the scene? If yes, can it spawn some extra SPIDs? How does it handle lock or sequencing? Because in the hypothetic scenario above Step N+1 re-uses the results of Step N so it has to wait for Step N to complete.
Thanks very much in advance for any help.
View 2 Replies
View Related
Mar 9, 2000
Hi All
IF some users are still connected to the database and I want to shutdown the server How can I disconnect them in order to shutdown.
Sincerely.
View 1 Replies
View Related
Jul 21, 2007
The package has 15 DTS 2000 tasks that execute sequentially, depending on 15 successes. The 15th task then invokes 11 more DTS 2000 tasks simultaneously which each invoke a mail task on their success. The package is saved as part of a valid project. The entire package is successful executing within Visual Studio -- 37 green boxes. I move the package as file system .dtsx to my database as a stored package within MSDB and then schedule it as a job via SQL Agent invoking the MSDB stored package.
The package has a log file referenced in the scheduled job for errors and diagnostics while each of the 26 Transforms Data Tasks within the DTS 2000 packages writes to a fully qualified exception file on my server. The log and exception files have valid data when the package runs in Visual Studio but the exception files are untouched when the job fails and the log only references one of the 11 dependent steps with a job failed message. SQL tables are updated and files created from the Visual Studio execution but nothing is created when the job fails.
I am assuming there is a disconnect with the way I am moving the package to the scheduled job but I don't know what the problem is. Can anyone help?
Den
View 2 Replies
View Related
Jul 23, 2005
I wonder if anyone has any hard fact based pro or contra, especially onperformance, about having views as opposed to tables when the object isbeing accessed for read only by multiple sessions/users/spids. I amparticularly concerned about the multiple instantiations of the view.Relevant thoughts on this are much appreciated.Thanks,Caveman
View 1 Replies
View Related
Mar 6, 2004
Hello,
I need to attach and detach 50 DB's, for which I have wrote a simple script. How can I make sure that there are no connections or users connected to the DB's, if there any users how can I forcefully disconnect them.
Thanks
Dakki
View 7 Replies
View Related
Sep 12, 2014
I've written a query calling for the max disconnect date within a table, but I would also like to make sure to only retrieve records with the most recent connect date. I'm unsure how to go about adding the additional max date function to my query. Here's what I have written:
select distinct T.PRIN_MON, T.AGNT_MON, T.SUB_ACCT_NO_MON, T.TRAN_DTE_MON, T.TRAN_CDE_MON,
T.TRAN_AMT_MON, EQ.eqp_stat_eqp,
case when h.acct_stage_ohi = 'v' then 'VOL_DISCO'
when h.ACCT_STAGE_OHI = 'n' then 'NON_PAY_DISCO'
ELSE '' END AS 'CUSTOMER_STATUS',
[Code] ....
View 1 Replies
View Related
Jan 16, 2006
I am building a package that will be used to transfer data from Access 2000 to SQL 2005. For development purposes, the first thing I do is search for my SQL database. If it is there, I drop and recreate it. If I run the package once, it runs fine, . After that, I get the message that the database is in use and can not be deleted. I do not have Mgmt Studio open, so the only thing that could have a connection is the BI Studio. The only way I can seem to clear it, is to close and reopen BI Studio and the package. To make matters worse, it does not happen all the time. So sometimes I can run the package as many times as I would like, until it chokes, and then I get to start all over again. Has anyone else seen something like this, or am I missing something in the package and/or task settings? Please let me know.
Thanks,
DO
View 7 Replies
View Related
Mar 20, 2000
I need a stored proc to kill spids, but the following sproc loops infinitely with the same [correct] spid being printed out. What am I doing wrong?
The select statement, when I execute it via the query grid, returns the correct and finite number of spids.
Any help greatly appreciated.
Judith
CREATE PROCEDURE rasp_KillDBProcess
@dbname varchar(128)
AS
declare @KillSpid smallint
declare @SQL varchar(1000)
--
declare DBCursor cursor Forward_only for SELECT distinct l.spid
FROM master.dbo.syslocks l INNER JOIN
master.dbo.sysdatabases d ON l.dbid = d.dbid
WHERE (d.name = N'coj_pcisdata')
open DBCursor
--
Fetch next from DBCursor into @Killspid
--
While (@@Fetch_status <> -1)
Begin
If (@@Fetch_status <> -2)
begin
print 'spid = ' + cast(@killspid as varchar(12))
--exec ('kill ' + @killspid)
end
--
end
Fetch next from DBCursor into @Killspid
--
close dbcursor
deallocate dbcursor
print 'end'
return
View 1 Replies
View Related
Aug 20, 2015
I need a script to kill existing sessions on [db1] and [db2] except sessions from [user1]. I have a script like this now:
USE master
GO
DECLARE @kill varchar(8000) = '';
SELECT @kill = @kill + 'kill ' + CONVERT(varchar(5), spid) + ';'
FROM master..sysprocesses
WHERE dbid = db_id('db1)
EXEC(@kill);
I just need to extend to run on db2 and don't kill sessions from user1
View 3 Replies
View Related
Sep 29, 2007
Hi,
I have a SSIS Package which I would like to modify using SSIS API. I need to put new component between some two existing data flow's components. During this process I need to disconnect two data flow's components using SSIS API. How can I do that?
Thanks,
Rafal
View 1 Replies
View Related
Nov 11, 2015
Every day between 1AM to 2AM client disconnect happens and it's not too long also...it's about 30secs...nothing is recorded from SQL side and application server side and then we checked the network...there is no disconnect from network side too. How can i find the cause for disconnect.
View 4 Replies
View Related
Nov 6, 2015
I've installed the MDW (Mangement Data Warehouse) database on our central monitoring SQL Server. I've then added a number of servers to be monitored. The data is collected on the servers that are being monitored and uploaded to the central MDW Monitoring server.
On the servers that are being monitored, I'm seeing a large number (over 1000) of SPIDs being generated by 'SQL Server Data Collector'.
Is this normal behaviour? I've seen more blocking as a result of this.
Is there any way to reduce the number of SPIDs generated?
View 0 Replies
View Related
Dec 7, 2006
This is my first time to deploy an asp.net2 web site. Everything is working fine on my local computer but when i published the web site on a remote computer i get the error "Failed to generate a user instance of SQL Server due to failure in retrieving the user's local application data path. Please make sure the user has a local user profile on the computer. The connection will be closed" (only in pages that try to access the database)
Help pleaseee
View 3 Replies
View Related
May 14, 2007
I need to return the number of min from a table I am using the following query. But it gives me an error "Msg 241, Level 16, State 1, Line 1Syntax error converting date time from character string". can someone please help.SELECT DateDiff(Mi, CAST((SCHDATE + ' ' + SUBSTRING(SCHTIME, 1,2) + ':' + SUBSTRING(SCHTIME, 3,4)) AS DateTime), CAST((ACTDATE + ' ' + SUBSTRING(ACTIME, 1,2) + ':' + SUBSTRING(ACTIME, 3,4)) AS DateTime)) AS StopMinutes, BACPY, BARTRM, BAORD, BSAPOR, BABLN, BSASSQ, BSACNO, CSTRDATA, BSASCY, BSASST, TTLREV, SHAALP, SCHDATE, SCHTIME, ACTDATE, ACTIME, OQTCOD, BAADES, PCS, WGT, Tractor, Driver FROM dbo.JCI_Delivery_Report
View 3 Replies
View Related
Dec 11, 2000
Hi,
i have 3 fields: start_inspect_datetime, end_inspect_datetime, Diag_Hrs.
so i want to get the difference of start and end datetime=Diag_Hrs.
here i am using the below stored proc.
but i am getting only the hours or minutes or seconds.
so how to get the hours(if diff>59 mins),minutes(if diff>59 sec),seconds.
for Ex: here diff=185 sec. then Diag_hrs should be 3 hours,0 mins, 5 secs.
so how we'll get this.
pl help me out asap.
Thanx
reddy
select Asset_Diag_Hrs= DATEDIFF(hh,start_inspect_datetime,end_inspect_dat etime) from asset_diag_trans_table
--where Gpc_no=@GPC_no
--select Asset_Diag_Hrs=(datediff(mm,start_inspect_datetime ,end_inspect_datetime)) from asset_diag_trans_table
-- where Gpc_no=@GPC_no
select Asset_Diag_Seconds=(datediff(ss,start_inspect_date time,end_inspect_datetime) ) from asset_diag_trans_table
where Gpc_no=@GPC_no
View 3 Replies
View Related
Oct 24, 2000
Can i restore a diff. backup alone without a complete backup?
(what i am trying is this.....there are two different servers at two diff. places....i need to have both servers in sync. at all times.modifications will take place in one server and the modifications have to be reflected in the other server.i could not go for replication as the servers cannot be connected.sending complete backups daily will be a overhead .hence planning to take complete backup once and send diff. backups alone on subsequent days to the other server.
how can i achieve this?)
View 1 Replies
View Related
Mar 22, 2006
Dear all
I am new to the MS SQL, my problem is as follows.
I am having a online database on sql 2k.
every 15 days we have to give payout from our system, so we
have a offline server in our office, we take the complete backup of that day & restore the same on the offline server,
& start the payout process.
The problem is that the full backup is a big file & take a lot of time for downloading from online server.
is it possible that we take on diff. backup of that day & will restore the same on the offline server so the file will take less time to download.
but my offline backup is 15 days old, will that update all the records or not?
regards
Abhijit
View 4 Replies
View Related