SQLserver2008 A critical error has occurred with the current command. Any results that may be produced should be discarded

Source: Internet
Author: User

Tag: Data does not have an SDN OSS structure single ASP script name

Development colleagues say that when a stored procedure executes to the Pm_x table, it throws "a serious error occurred in the current command." Any error that may result "shall be waived;

Log in to the SQL Server database and look at the number of rows and sizes of this table first:

exec spaceused ' pm_x ', just hundreds of thousands of rows, hundreds of trillion, not big, really small.

Then select * Into #nb from pm_x, also directly error, suspect this table structure error, cause the table can not scan full table, so need to repair it.

Because this system database is critical and its associated business is complex, you can limit the contact with the business database to which it is contacted by changing the IP of this server , and then execute the following script:

Use pmdeclare @dbname varchar (255) Set @dbname = ' PM ' exec sp_dboption @dbname, ' Single user ', ' true ' DBCC CHECKTABLE (' pm_x ', Repair_allow_data_loss) exec sp_dboption @dbname, ' Single user ', ' false ' then, wait a moment, execute successfully, then select * from Pm_x, no more error, Development of stored procedures can also run normally. Guess, this kind of table error, feel like Oracle's logical bad block, but found that SQL Server does not have this record bad block view. in operations, there are two kinds of operations called "big strokes"--restarting the server; replacing the IPFor the meaning of the DBCC CHECKTABLE parameter, see the official documentation: Https://msdn.microsoft.com/zh-cn/library/ms174338.aspx.

SQLserver2008 A critical error has occurred with the current command. Any results that may be produced should be discarded

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.