We have an issue where a cube hasn't been designed properly - when someone queries it with Excel, it is doing a mega-crossjoin. When anyone else tries to do *anything* on the AS server (connect with management studio, etc.) it just hangs. We have to either track down the person running the query (via the flight recorder), or restart the service. Obviously the correct fix is to change the design of the cube - I plan on doing it asap. But it brings up this important question - is there a setting I can change to allow others to use the box while this is going on? Maybe some thread isolation, or parallelism? I'm just throwing out ideas, as I haven't experienced this part of AS administration yet.
In my final project, the biggest time consuming issue was writing a query, when there are 15 fields on the average than it is certainly not easy to write an SQL statement and run it (through code)
So I want to know, is there any automatic query generator ? that could work like: 1) We enter all control names 1 by 1 2) we enter postfix text ( like .Trim(), .ToString() ) etc 3) Result should be automatically generated query
Is there any software/program for that ???
Infact it is very easy to develop myself, but I dont want to waste the time if such tool (most probably) already exists
Hey, How can we kill a process initiated by an Extended Stored Procedure. For example, I issued exec xp_cmdshell "C:Notepad.exe" and scheduled as a job and it started running and it never finished. I dunno watz goin on behind the scene and i couldnt kill the process. Anybody who knows how to do it,please help me out. And my process is still running in the server for more than two days. Do i have to restart the server? If so, everytime when it get a problem like this, am i supposed to restart?
Hi, i was try a very simple transaction, but it show me error: Exception Details: System.InvalidOperationException: This SqlTransaction has completed; it is no longer usable. Below is my code, wat i did wrong for tis... i tried 2 days just for transaction alrd.... pls help.Sub bt1_click(sender as object, e as eventargs) dim i as integer Dim myTrans As SqlTransaction dim strExDate,StrSAPNum,strID,StrPartNum,strRemark,strWAID,strQty,strQty1,StrPartNum1 as string '================ loop thru n insert data=============================== try for i=0 to DgData.items.count-1 strExDate = CType(dgData.Items(i).FindControl("tbExDate"), textbox).text strRemark = CType(dgData.Items(i).FindControl("tbRemark"), textbox).text strQty = CType(dgData.Items(i).FindControl("tbQty"), TextBox).text StrSql="Insert into tbl_GrDE(Qty, ExDate, Remark, EntBy) Values " & _ (@Qty, @ExDate, @Remark, @EntBy)" ObjCmd=New SqlCommand(StrSql, ObjConn) With ObjCmd.Parameters: .Add(New Sqlparameter("@qty", strQty)) .Add(New Sqlparameter("@ExDate", strExDate)) .Add(New Sqlparameter("@Remark", strRemark)) .Add(New Sqlparameter("@EntBy", session("User_ID"))) End with ObjCmd.Connection.Open() myTrans = ObjConn.BeginTransaction ObjCmd.Transaction = myTrans ObjCmd.ExecuteNonQuery() ObjCmd.Connection.Close() next myTrans.Commit() catch ex as exception response.write("error") myTrans.Rollback() end tryEnd SubRegardslife's Ng
Hi One DTs package job running and we stop the job.Job was stoped but process not killing.We tried using kill spid but no use.please any body give suggestion. this production server.
Please could anyone help I run an restore on a specific database overnight, in order to do so I have to kill all user connections. When I try to kill all user SPIDs some still remain ? , why please can anyone help me !
I have a spid that I'm not able to kill, this were a select statement from with in access 97 application using a DNS connection. So even that I reboot the client pc and kill the spid it still shows as active with status RollBack. We have similar problem before and the only way that it disappear were re - starting Sql. (system Sql 7.0 with sp1 and Access 97)
I have a script that I use to see if someone has been logged in for too long. Does anyone know how to take a varible spid and kill that login. I tried using kill @spid, but that does not work. Any Suggestions?
I hope you can help me to find the way to resolve this issue.
When I've accidentally triggered a process in SQL 6.5 without knowing that it's going to hold a lot of resources and making the network very slow and end users will be started complaining about the slowness.
I've no other way other than the killing the process kill <spid>. Funniest part is, even it is not get killed even when I tried multiple times and the process is still active and still running.
When I tried to find the way out, One another guy stopped the SQL server and restarted again. That's it, it took a long time to stop and restart and ends up with the recovery mode of the database and it was running more than 3-4 hours to get into the usual mode.
Based on the scenario, what would be your suggestion when I've encoutered the same situation. I've triggered some application like DBCC checkdb and it's keep running for a long time. But I need to kill the process immediately without affecting any other process. Pls. advise me.
I have a problem. I am trying to kill a spid that is blocking updates to a table. The spid number is '-2'. I am using KILL with UOW and I am getting this error:
Server: Msg 6112, Level 16, State 1, Line 1 Distributed transaction with UOW {FCF8D536-27ED-11D6-9CF2-0002A56BDA54} is in prepared state. Only Microsoft Distributed Transaction Coordinator can resolve this transaction. KILL command failed.
Users are connecting through MTS server. I am runnnig SQL2000 sp2 +hotfix, on NT4.0.
Has anyone encountered this problem before, and has a solution for it (besides rebooting the MTS and SQL Server)?
Just wondering if there is any way to kill a thread within an sqlerver process. The thread we are trying to kill is a rollback statement that has been running for a very long time.
If we have a deadlock we will check in the error log and and find the spids which are involving in the deadlock. We will kill one of the process by using SPID (no) KILL. Is there specific steps to consider while killing a process
I wish to select processes from sysprocess that are SLEEPING and more than a certain time old (say 10 minutes) so that I may KILL them. I can get the query to do the select, but how do I KILL the process? I have tried selecting the SPID into a local variable and then trying KILL @var_name, but I get "Incorrect syntax near '@var_name'".
I have tried all of the resources that I can find, but without success. Is this possible? If so, how do I go about doing it?
If I kill a blocked process, why does the current activity window still show the process? Both processes, blocking and blocked, are scheduled tasks. Also, the blocked process is still listed as a running task in the manage scheduled task window.
Hi Peepz! my problem is this i am managing more than 3 servers which has a many users. this servers have one common problem. the most users uses high cpu utilizations what make it worst is even if the process is already done for a long time (status = sleep) they still uses high cpu or IO utilization. One time i ask to confirm one user if they are really having that process and found out that the user have gone home already and no other is using thier computer. And assuming that we have more than 20 users with the same case it really make the server slow and occationally hangup. i try to kill these process/user but i think killing is not an option. Kindly help pls. are there any way to refresh connections or terminate it, how do you handle this situations?
Thanks, Keez.
If you give me a fish ill eat for a day but if you teach me how to fish ill eat for life. :beer:
I am working with a report performance issue.The report is a consolidated report of 4 other report. I need to remove one of the report from that. How to do?
I did Index defragmentation a week ago . for 1 database only , In the middle of rebuild I kill the process twice cause It takes more than 1 hour so I killed it and wonder how many high level fragmented indexes left ...
Hi everybody,We have a very large database and high transaction volume. Time to timethese transactions are locking each other and decrease the performanceof the database. Is there any way that I can automate the killingprocess when blocking and deadlock time is exceeded in certain timeelipsade? Can somebody help me on this please?Regardsasa.
I am having a problem with an application that does not kill timed out connections. This is normally not an issue, but when something causes the timed out connections to build up, it stops the frontend from working correctly. The frontend developers are trying to figure out how to change their code to check for and drop timed out connections at the application. Until then, I need a way to check for timed out connections at the database and drop them there via a job that will run every 10 minutes or so. I have to make sure that only timed out connections are dropped and not active ones. Any suggestions?
I would like your help with the Foreach loop container. Boy, am I having issues with using it for looping through an ADO.NET dataset or what!?!? My control flow has a data flow task that is executing a Data Reader task (creating a .NET dataset for me). Now I go back to the control flow and add a Foreach loop container to loop through each record in my dataset. But which type of the Foreach loop container should I be using? I see an option to use Foreach ADO.NET schema enumerator but not sure how to configure it. Also I used the Foreach ADO option, but setting up variables to go through every column is an absolute pain in the you know what!!?!! I have about 200 columns and I want an easier way to refer to those columns in my transformation phase.
I have recently started working with a new group of people and I find myself doing a lot of reporting. While doing this reporting I have been writing a TON of sql. Some of my queries were not performing up to par and another developer in the shop recommended that I stay away from the "GROUP BY" clause. Backing away from the "GROUP BY" clause and using "INNER SELECTS" instead as been more effective and some queries have gone from over 1 minute to less that 1 second. Obviously if it works then it works and there is no arguing that point. My question to the forum is more about gather some opinions so that I can build an opinion of my own. If I cannot do a reasonable query of a couple of million records using a group by clause what is the problem and what is the best fix? Is the best fix to remove the "GROUP BY" and write a query that is a little more complex or should I be looking at tuning the database with more indexes and statistics? I want to make sure that this one point is crystal clear. I am not against following the advice of my coworker and avoiding the "GROUP BY" clause. I am only intersted in listening to a few others talk about why the agree or disagree with my coworked so that I can gain a broader understanding.
I have a scheduled job that will do a database restore at given time every day. Sometimes I run into a situation where some people leave themselves logged on to the database, which prevents the job from running.
Is there a way that I can set up my job to include killing any open processes against the database that I'm restoring prior to the restore being done?
I am having a few problems using ASP-DB advertised on this site. Queries that were working rather quickly a week ago are timing out for no apparent reason. (asp-db seems to be buggy)
I have no idea as to what is causing the query (ie select * from tables X, Y, Z) to time out. The process id on SQL server says AWAITING COMMAND or SLEEPING.
Also, the processes on SQL server do not seem to die. Can this be accomplished via ASP or other means.
we have tables that load overnight. Sometimes a user will try to run a query up against that table while the table is loading and a deadlock occurs. I do not notice this until I get into the office. By this time many tables have not loaded. Is there a way to have SQL6.5 automatically Kill deadlock processes.
I ran a DBCC SHOWCONTIG on a large database. Because the execution was taking longer than I wanted I cancelled and then killed the process running the DBCC. This action seems to have abnormally ended SQLServer and subsequently crashed the entire NT server. Have you experienced any behavior similar to this when using DBCC and/or killed processes?
Hi, i wanted to ask on the same context of bcp...i m trying to insert two rows into a table using the bcp command prompt and the bcp file looks as follow(format.fmt): 7.0 3 1 SQLCHAR 0 4 ""," 1 numbers 2 SQLCHAR 0 15 """ 2 values 3 SQLCHAR 0 2 " " 3 finish
and the input file has the following contents 1234,"other" 5678,"column"
now when i m running the command as bcp master.dbo.two_column in c: empinput.txt -fc: empformat.fmt -Sserver -Uuser -Ppasword -T
it gives me the error as sqlstate 07009 with native state =0 and the error as = [Microsoft][SQL Native Client] Invalid descriptor index
i m using sql server 2005 (YUKON)...can anyone pleaseeeeeeeeeeeeee tell me how can i solve this problem?????????????????so that i can insert these rows into my table two_column.... thanks ...pleaseeeeeeeeee help me....
I keep getting different answers from different people on regarding if you can or cannot kill the hosting sql server process with an unsafe assembly. Can you do this? If so could you please attach a sample demonstrating this?
i have SQLServer2000 and 2005 installed,established one connection each from Query Analyze(SQLServer2000 ) and Microsoft SQL Server Management Studio - Query (SqlServer2005). Written a script to disconnect all connection.It work fine in case of SQLServer 2005 but do not kill connection from Query Analyze(SQLServer2000 ). On quering sys.dm_exec_sessions do not show any connection.But when i execute the query from Query Analyze(SQLServer2000 ) it return the result in place of disconnect error.
DECLARE @spid INT
DECLARE @tString varchar(15)
DECLARE @getspid CURSOR
SET @getspid = CURSOR FOR
select session_id from sys.dm_exec_sessions where session_id>28 and
host_name NOT IN ('xxx') and program_name in ('SQL Query Analyzer','SQL Query Analyzer - Object Browser',
'SQLCMD','OSQL-32','Microsoft SQL Server Management Studio')
OPEN @getspid
FETCH NEXT FROM @getspid INTO @spid
WHILE @@FETCH_STATUS = 0
BEGIN
SET @tString = 'KILL ' + CAST(@spid AS VARCHAR(5))
EXEC(@tString)
Print @tString
FETCH NEXT FROM @getspid INTO @spid
END
CLOSE @getspid
DEALLOCATE @getspid
Please let me know why Query Analyze(SQLServer2000) connection disconnect on killing the respective spid. Regards Sufian