Failed to open Crystal Reports - sql-server

When I try to run crystal reports the following Error is appears:
Transaction (Process ID 159) was deadlocked on lock | communication buffer resources with another process and has been chosen as the deadlock victim. Rerun the transaction
Note: Report is connect directly to stored procedure.

This sounds to me like it's a SQL Server issue and not Crystal. The query that you are executing is causing a deadlock situation. Try running SQL Profiler while executing your report and see what's causing the deadlock.

Related

The Query had to wait XX seconds for MemoryGrant

I got the warning message
The query had to wait xx seconds for MemoryGrant during execution
from the SQL execution plan. May I know what are the reasons/possibilities that would cause this warning message to appear?
Is it due to system memory leak or waiting for others pending SQL queries to be finished?
I extracted the query from SQL profile which is generated from Entity Framework(Linq) and run in SSMS 2019.

Retriving a week old deadlocks in SQL Server

Is any possible way to find which process caused a deadlock last week in SQL Server? I checked Extended Events that only keeps data from last night. If anyone can share a script to find out would be helpful.
The job has completed with an error - Database server name: ################- Transaction (Process ID 279) was deadlocked on lock resources with another process and has been chosen as the deadlock victim. Rerun the transaction.
System.Data.SqlClient.SqlException (0x80131904): Transaction (Process ID 279) was deadlocked on lock resources with another process and has been chosen as the deadlock victim. Rerun the transaction.
It is possible to retrieve deadlocks details from Extended Events -> Sessions -> System_health -> right click on package0.event_file and choose view target data, next you need to sort by name to see the deadlock report in XML form and also as graphs. But for this you need to enable trace 1204 and 1222 prior to the deadlocks occurrence.
These are the trace that you need to enable.
DBCC TRACEON (1204,-1)
DBCC TRACEON (1222,-1)
Click here for more details...

Locked by wait type OLEDB with SQL server 2012

I have a batch process that generate one linked server over huge Excel files to fetch data into SQL Server 2012
Sometimes the process is locked by a wait type "OLEDB"
I can't find the root ause but my biggest problem is that I can't kill the process that has the wait_type OLEDB
I have try
KILL spid
Not works, never kill the spid.
SPID 90: transaction rollback in progress. Estimated rollback completion: 0%. Estimated time remaining: 0 seconds.
ALTER DATABASE [DataMigration] SET SINGLE_USER WITH ROLLBACK IMMEDIATE
But never finish (due PRINT_ROLLBACK_PROGRESS)
If I look into the process, I see the file that cause the block, but I don't know how solve the issue
SELECT * FROM SYSPROCESSES where spid=90
-There is any way to kill this process without restart the servers?
-How can avoid the wait type OLEDB? the same file in the same location usually works fine, the process hangs only some times.
This is quite simple. OLEDB as a wait type often indicates some wait on another Server. This is also the reason why you can't kill the process. OLEDB is often (not always) used as a wait type for connections between SQL Server instances.
You kill the connection on your server, but if the process is running on another instance/linked server it will run there too. It will kill the process after the process on the other instance is finished.
So much to the bad news. The good news for you is, that you easily can find the query which runs on another linked server using this query:
SELECT spid, waitresource
FROM sys.sysprocesses
WHERE spid = <yourKilledSpid>
Just filter it for the spid you try to kill. The waitresource will indicate the remote server including the spid on the remote server. Go to the remote server and kill the spid there too. Your connection will immediately be killed/rolledback. Hopefully this solves your issue.
You can additionally try to take a look at the waiting_tasks. Maybe you'll see something helpful like a blocking resource in there.
SELECT *
FROM sys.dm_os_waiting_tasks

Web Deploy SQL Server gives deadlock when creating a stored procedure

We use web deploy packages to create and deploy a SQL Server database, when running it we encounter on a specific stored procedure the following error:
Error: An error occurred during execution of the database script. The
approximate location of the error was between lines '1481' and '1586'
of the script. The verbose log may have more information about the
error. The command started with :
CREATE PROCEDURE [dbo].[csp_MyCoolStoredProcedure
Error: Transaction (Process ID 53) was deadlocked on lock resources with another process
and has been chosen as the deadlock victim. Rerun the transaction.
Error count: 1."
When we run the database script that is in the package using SQL Server Management Studio everything works fine so there are no errors in the script, anyone has an idea on what is going wrong, the verbose option doesn't give any better error message :(
inside the project file, set transaction="false" for every sql script element

SQL Server Process Id Lock Error

This is Error.I am getting while inserting the record to Database Save
Transaction (Process ID 78) was deadlocked on lock resources with another process and has been chosen as the deadlock victim. Rerun the transaction.
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.
Can any one tell me why SQL is showing this kind of Error.
This is being shown because someone else was locking the records in which you were trying to write with your transaction, and you were trying to lock records the other transaction was trying to write to.
http://blog.sqlauthority.com/2007/05/16/sql-server-fix-error-1205-transaction-process-id-was-deadlocked-on-resources-with-another-process-and-has-been-chosen-as-the-deadlock-victim-rerun-the-transaction/
There's a good explanation on that url.

Resources