Sql при выполнении текущей команды возникла серьезная ошибка

Running the following query in SQL Server Management Studio gives the error below.

update table_name set is_active = 0 where id  = 3

A severe error occurred on the current command. The results, if any, should be discarded.

  • The logs have been truncated
  • there is an update trigger but this isnt the issue
  • the transaction count is zero (@@trancount)

I have tried the same update statement on a couple of other tables in the database and they work fine.

DBCC CHECKTABLE('table_name');

gives

DBCC results for 'table_name'.
There are 13 rows in 1 pages for object "table_name".
DBCC execution completed. If DBCC printed error messages, contact your system administrator.

p.campbell's user avatar

p.campbell

98.2k67 gold badges255 silver badges321 bronze badges

asked Jul 24, 2009 at 0:34

Paul Rowland's user avatar

Paul RowlandPaul Rowland

8,24412 gold badges55 silver badges76 bronze badges

1

I just had the same error, and it was down to a corrupted index.
Re-indexing the table fixed the problem.

Clint's user avatar

Clint

2,66623 silver badges42 bronze badges

answered Aug 18, 2010 at 16:23

LauraB's user avatar

2

In my case,I was using SubQuery and had a same problem. I realized that the problem is from memory leakage.

Restarting MSSQL service cause to flush tempDb resource and free huge amount of memory.
so this was solve the problem.

answered Jan 7, 2013 at 7:06

ARZ's user avatar

ARZARZ

2,4613 gold badges34 silver badges56 bronze badges

0

Run DBCC CHECKTABLE('table_name');

Check the LOG folder where the isntance is installed (Program FilesMicrosoft SQL ServerMSSQL.1MSSQLLOG usually) for any file named ‘SQLDUMP*

answered Jul 24, 2009 at 0:39

Remus Rusanu's user avatar

Remus RusanuRemus Rusanu

287k40 gold badges437 silver badges567 bronze badges

2

answered Jul 24, 2009 at 4:12

gbn's user avatar

gbngbn

420k81 gold badges585 silver badges674 bronze badges

1

In my case, I was using System.Threading.CancellationTokenSource to cancel a SqlCommand but not handling the exception with catch (SqlException) { }

answered Apr 12, 2017 at 22:14

Leo Gurdian's user avatar

Leo GurdianLeo Gurdian

2,08917 silver badges20 bronze badges

1

This error is exactly what it means: Something bad happened, that would not normally happen.

In my most recent case, the REAL error was:

Msg 9002, Level 17, State 2, Procedure MyProcedure, Line 2 [Batch Start Line 3]
The transaction log for database 'MyDb' is full due to 'LOG_BACKUP'.

Here is my checklist of things to try, perhaps in this exact order:

  1. Check if you’re out of disk space (this was my real problem; our NOC did not catch this)
  2. Check if you’re low on memory
  3. Check if the Windows Event Log shows any serious system failures like hard drives failing
  4. Check if you have any unsafe code loaded through extended procedures or SQLCLR unsafe assemblies that could de-stabilize the SQLServer.exe process.
  5. Run CheckDB to see if your database has any corruption issues. On a very large database, if this stored procedure only touches a sub-set of tables, you can save time by seeing which partitions (filegroups) the stored procedure touches, and only checking those specific filegroups.
    1. I would do this for your database and master db as well.

answered Jun 6, 2019 at 17:33

John Zabroski's user avatar

John ZabroskiJohn Zabroski

2,1932 gold badges27 silver badges54 bronze badges

3

This seems to happen when there’s a generic problem with your data source that it isn’t handling.

In my case I had inserted a bunch of data, the indexes had become corrupt on the table, they needed rebuilding. I found a script to rebuild them all, seemed to fix it. To find the error I ran the same query on the database — one that had worked 100+ times previously.

answered Oct 20, 2019 at 22:46

Paul Hutchinson's user avatar

Paul HutchinsonPaul Hutchinson

7891 gold badge12 silver badges27 bronze badges

in my case, the method: context.Database.CreateIfNotExists(); called up multiple times before create database and crashed an error A severe error occurred on the current command. The results, if any, should be discarded.

answered Dec 7, 2020 at 13:27

Silny ToJa's user avatar

Silny ToJaSilny ToJa

1,7551 gold badge6 silver badges16 bronze badges

I was having the error in Hangfire where I did not have access to the internal workings of the library or was I able to trace what the primary cause was.

Building on @Remus Rusanu answer, I was able to have this fixed with the following script.

    --first set the database to single user mode
    ALTER DATABASE TransXSmartClientJob
    SET SINGLE_USER
    WITH ROLLBACK IMMEDIATE;
    GO

    -- Then try to repair
    DBCC CHECKDB(TransXSmartClientJob, REPAIR_REBUILD)

    -- when done, set the database back to multiple user mode
    ALTER DATABASE TransXSmartClientJob
    SET MULTI_USER;
    GO

answered Aug 28, 2020 at 11:46

Shittu Joseph Olugbenga's user avatar

One other possible solution we just found after having this issue across multiple databases/tables on the same server.

Is the max connections open to the sql server. We had an app that wasn’t closing it’s SQL connection and was leaving them open so we were running around 28K-31K connections (SQL Sever has a max out at 32K ish), and we noticed that once we killed a few thousand sleeping connections it took care of the error listed on this question.

The fix was to update the apps to make sure they closed their connections instead of leaving them open.

answered Oct 21, 2020 at 15:36

tryonlinux's user avatar

tryonlinuxtryonlinux

1081 silver badge11 bronze badges

In my case it was something else, += operator caused this. I had to replace += X with field = field + X to overcome this. I assume this is a bug though I wasn’t able to find any related KB on Microsoft sites.

I am using SQL Server 2008 R2(10.50.1600).

answered Jan 4, 2021 at 9:44

MelOS's user avatar

MelOSMelOS

5955 silver badges10 bronze badges

Just wanted to add my 2cents to help whomever the next person that comes across this is.

We noticed that a specific report was failing after half an hour. I assumed it was a timeout as the amount of data being returned was huge. It turns out the SSRS default timeout setting is 1800 seconds (30mins). I changed the setting on this specific report to run indefinitely with no timeout and that resolved our issue.

Next step is to identify ways to improve the performance of the MSSQL behind the report :)

answered Jun 14, 2022 at 3:21

L.Newell's user avatar

L.NewellL.Newell

1001 gold badge2 silver badges13 bronze badges

I had the same issue but the table was too big the I couldn’t fix it from the UI or by dropping and creating all indexes.
So here is another way to solve this , or at least it worked for me.

  1. I have backed up the database to a BAK file
  2. I have create a new database from newly backed up file and called the new database the same name but with appendix of «_BK» like this : myDatabase_BK
  3. The «bad table» on the new database was already working well without the error — so it seems that the deployment fixed the problem for the new database
  4. So what left was to rename the bad table on the live database(myDatabase) and then to create the same table from the backup (after renaming myDatabase.myTable):select * into myDatabase.myTable from myDatabase_BK.myTable
  5. Make sure to create all indexes on the new table.

answered Jun 19, 2022 at 7:14

Gil Allen's user avatar

Gil AllenGil Allen

1,16914 silver badges23 bronze badges

I received this same exception, but it was due to the fact that I was using Polybase to issue a query to an external table from an API request that was enlisting in a Transaction via TransactionScopes. The exception thrown from ADO.Net was the unhelpful: «A severe error occurred on the current command».

However, in SSMS, I did the following which finally made me realize that it was the transaction that was causing this issue:

  • View Object Explorer
  • Expand the Management Node
  • Expand SQL Server Logs
  • View the current log, and the errors that are logged when this exception was logged.

I saw the following:

Unsupported transaction manager request 0 encountered. SQL Server Parallel DataWarehousing TDS endpoint only supports local transaction request for 'begin/commit/rollback'.

I then placed this particular query in another transaction scope, suppressing the transactionscope that it would have enlisted in, and it worked.

using (var transactionScope = this.transactionScopeFactory.Create(
    System.Transactions.TransactionScopeOption.Suppress,
    new System.Transactions.TransactionOptions { IsolationLevel = System.Transactions.IsolationLevel.ReadCommitted },
    System.Transactions.TransactionScopeAsyncFlowOption.Enabled))
{
    // ... query

    transactionScope.Complete(); // Suppress scope option renders this unnecessary, but just a good habit
}

answered Nov 3, 2022 at 19:40

Seth Flowers's user avatar

Seth FlowersSeth Flowers

8,9602 gold badges29 silver badges42 bronze badges

SQL Server 2012 Developer SQL Server 2012 Enterprise SQL Server 2012 Standard Еще…Меньше

Корпорация Майкрософт распространяет исправления Microsoft SQL Server 2012 в один файл для загрузки. Поскольку исправления являются кумулятивными, каждый новый выпуск содержит все исправления и исправления для системы безопасности, которые были включены в предыдущий выпуск исправлений для SQL Server 2012.

Проблемы

При выполнении полнотекстового запроса, содержащего предикат CONTAINS, а предикат CONTAINS также имеет термин NEAR близость в SQL Server 2012, появляется следующее сообщение об ошибке:

Сообщение 0, уровень 11, состояние 0, строка 0, в текущей команде произошла серьезная ошибка. Результаты, если таковые имеются, должны быть удалены.

Кроме того, в журнале событий сервера SQL Server регистрируется следующее сообщение об ошибке:

Причина

Эта проблема возникает из-за ошибки в конвейере полнотекстового запроса.

Решение

Сведения о накопительном пакете обновления

Накопительный пакет обновления 1 (SP1) для SQL Server 2012 с пакетом обновления 1 (SP1)

Исправление для этой проблемы впервые выпущено в накопительном обновлении 1. За дополнительными сведениями о том, как получить этот накопительный пакет обновления для SQL Server 2012 с пакетом обновления 1 (SP1), щелкните следующий номер статьи базы знаний Майкрософт:

2765331 Накопительный пакет обновления 1 (SP1) для SQL Server 2012 с пакетом обновления 1 (SP1)Примечание. Так как сборки являются кумулятивными, каждый новый выпуск исправлений содержит все исправления и все исправления безопасности, которые были включены в предыдущий выпуск исправлений для SQL Server 2012. Рекомендуется установить последнюю версию исправления, которая включает это исправление. Дополнительные сведения см. в следующей статье базы знаний Майкрософт:

2772858 Сборки SQL Server 2012, выпущенные после выпуска пакета обновления 1 (SP1) для SQL Server 2012

Накопительный пакет обновления 3 для SQL Server 2012

Исправление для этой проблемы впервые выпущено в накопительном обновлении 3. Для получения дополнительных сведений о том, как получить этот накопительный пакет обновления для SQL Server 2012, щелкните следующий номер статьи базы знаний Майкрософт:

2723749 Накопительное обновление 3 для SQL Server 2012Примечание. Так как сборки являются кумулятивными, каждый новый выпуск исправлений содержит все исправления и все исправления безопасности, которые были включены в предыдущий выпуск исправлений для SQL Server 2012. Рекомендуется установить последнюю версию исправления, которая включает это исправление. Дополнительные сведения см. в следующей статье базы знаний Майкрософт:

2692828 Сборки SQL Server 2012, выпущенные после выпуска SQL Server 2012

Статус

Корпорация Майкрософт подтверждает наличие этой проблемы в своих продуктах, которые перечислены в разделе «Применяется к».

Дополнительная информация

Дополнительные сведения о поиске слов, близких к другим словам, можно найти на веб-сайте MSDN по следующему адресу:

Поиск слов, близких к другому слову

Нужна дополнительная помощь?

Нужны дополнительные параметры?

Изучите преимущества подписки, просмотрите учебные курсы, узнайте, как защитить свое устройство и т. д.

В сообществах можно задавать вопросы и отвечать на них, отправлять отзывы и консультироваться с экспертами разных профилей.

Добрый день.

MS SQL 2014 Standart with SP2 установлен на MS Win Server 2014r2 Standart.

В связи с тем-что из софтового рэйда intel «выпал» диск и никак не хотел этим рэйдом подхватываться было решено перенести рэйд на другой контроллер(LSI 9240). Был остановлен SQL сервер, затем скопированы все файлы баз данных
на резервный диск, затем пересобран рэйд и файлы бд скопированы обратно в те же директории. В связи с тем, что перед отключением SQL базы не были корректно отключены, начали возникать ошибки:

Microsoft SQL Server Native Client 11.0: Операционная система возвратила ошибку 1(Неверная функция.) в SQL Server при запись в смещении 0x00000003aa0000
файла «E:Datatempdb.mdf».

Отключили базы, удалили целиком SQL сервер, установили с нуля, подключили обратно. Ошибка больше не появляется. Но теперь появляется ошибка при попытке сжатия базы или журнала. Резервное копирование этих баз и журналов проходит корректно, DBCC
CHECKDB проходит без ошибок (если предварительно не сделать попытку сжатия).

ЗАГОЛОВОК: Microsoft SQL Server Management Studio
——————————

Действие Сжатие завершилось неудачно для объекта «База данных» «crm_demo».  (Microsoft.SqlServer.Smo)

Чтобы получить справку, щелкните: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=12.0.5000.0+((SQL14_PCU_main).160617-1804)&EvtSrc=Microsoft.SqlServer.Management.Smo.ExceptionTemplates.FailedOperationExceptionText&EvtID=Сжатие+Database&LinkId=20476

——————————
ДОПОЛНИТЕЛЬНЫЕ СВЕДЕНИЯ:

При выполнении инструкции или пакета Transact-SQL возникло исключение. (Microsoft.SqlServer.ConnectionInfo)

——————————

При выполнении текущей команды возникла серьезная ошибка.. При наличии результатов они должны быть аннулированы. (Microsoft SQL Server, ошибка: 0)

Чтобы получить справку, щелкните: http://go.microsoft.com/fwlink?ProdName=Microsoft%20SQL%20Server&ProdVer=12.00.5000&EvtSrc=MSSQLServer&EvtID=0&LinkId=20476

Перезапуск СУБД, естественно, пробовал. В логи ОС сыпется ошибка 9001, после отсоединения и присоединения базы ошибка в логах больше не появляется до следующей попытке сжатия базы.

Подскажите как решить данную проблему.

SQL Server 2012 Developer SQL Server 2012 Enterprise SQL Server 2012 Standard Еще…Меньше

Корпорация Майкрософт распространяет исправления Microsoft SQL Server 2012 в один файл для загрузки. Поскольку исправления являются кумулятивными, каждый новый выпуск содержит все исправления и исправления для системы безопасности, которые были включены в предыдущий выпуск исправлений для SQL Server 2012.

Проблемы

При выполнении полнотекстового запроса, содержащего предикат CONTAINS, а предикат CONTAINS также имеет термин NEAR близость в SQL Server 2012, появляется следующее сообщение об ошибке:

Сообщение 0, уровень 11, состояние 0, строка 0, в текущей команде произошла серьезная ошибка. Результаты, если таковые имеются, должны быть удалены.

Кроме того, в журнале событий сервера SQL Server регистрируется следующее сообщение об ошибке:

Причина

Эта проблема возникает из-за ошибки в конвейере полнотекстового запроса.

Решение

Сведения о накопительном пакете обновления

Накопительный пакет обновления 1 (SP1) для SQL Server 2012 с пакетом обновления 1 (SP1)

Исправление для этой проблемы впервые выпущено в накопительном обновлении 1. За дополнительными сведениями о том, как получить этот накопительный пакет обновления для SQL Server 2012 с пакетом обновления 1 (SP1), щелкните следующий номер статьи базы знаний Майкрософт:

2765331 Накопительный пакет обновления 1 (SP1) для SQL Server 2012 с пакетом обновления 1 (SP1)Примечание. Так как сборки являются кумулятивными, каждый новый выпуск исправлений содержит все исправления и все исправления безопасности, которые были включены в предыдущий выпуск исправлений для SQL Server 2012. Рекомендуется установить последнюю версию исправления, которая включает это исправление. Дополнительные сведения см. в следующей статье базы знаний Майкрософт:

2772858 Сборки SQL Server 2012, выпущенные после выпуска пакета обновления 1 (SP1) для SQL Server 2012

Накопительный пакет обновления 3 для SQL Server 2012

Исправление для этой проблемы впервые выпущено в накопительном обновлении 3. Для получения дополнительных сведений о том, как получить этот накопительный пакет обновления для SQL Server 2012, щелкните следующий номер статьи базы знаний Майкрософт:

2723749 Накопительное обновление 3 для SQL Server 2012Примечание. Так как сборки являются кумулятивными, каждый новый выпуск исправлений содержит все исправления и все исправления безопасности, которые были включены в предыдущий выпуск исправлений для SQL Server 2012. Рекомендуется установить последнюю версию исправления, которая включает это исправление. Дополнительные сведения см. в следующей статье базы знаний Майкрософт:

2692828 Сборки SQL Server 2012, выпущенные после выпуска SQL Server 2012

Статус

Корпорация Майкрософт подтверждает наличие этой проблемы в своих продуктах, которые перечислены в разделе «Применяется к».

Дополнительная информация

Дополнительные сведения о поиске слов, близких к другим словам, можно найти на веб-сайте MSDN по следующему адресу:

Поиск слов, близких к другому слову

ЛЭРС УЧЁТ

Загрузка…

Понравилась статья? Поделить с друзьями:
  • Sql ошибка строки не были обновлены
  • Sql server ошибка операционной системы 5 отказано в доступе
  • Sql ошибка синтаксиса create table
  • Sql server ошибка выделения памяти hresult 80004005
  • Sql ошибка при установке 20476