SQL tables always disappear after close the program

Xanakone SYPHANTHONG 0 Reputation points
2024-03-31T00:40:17.98+00:00

*** Solved Problem ***

I recently upgraded SQL Server Management Studio from version 19 to 20 a few days ago and encountered an issue. After creating a database and subsequently a table using the 'CREATE TABLE' command in a query, everything appeared to be functioning correctly. I connect it with my C# project and everything went well. However, I found that the tables were missing from the Object Explorer after closing and reopening the program, or perhaps after shutting down my laptop. Attempting to execute queries as before resulted in error messages. This problem never occurred with the previous version, and I'm unsure whether it's due to a mistake during the update process or an issue with the new version of the software.
Here's the error message:
The operating system returned error 21(The device is not ready.) to SQL Server during a read at offset 0x00000000056000 in file 'location file'. Additional messages in the SQL Server error log and operating system error log may provide more detail. This is a severe system-level error condition that threatens database integrity and must be corrected immediately. Complete a full database consistency check (DBCC CHECKDB). This error can be caused by many factors; for more information, see SQL Server Books Online.

--------------------- How i solved it -------------------------
I found some articles after post this question, and they recommend to turn off fast startup function of the windows then everything works fine.

SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
12,760 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Olaf Helper 40,901 Reputation points
    2024-03-31T05:01:37.3966667+00:00

    Complete a full database consistency check (DBCC CHECKDB)

    Do what the error message suggest.

    0 comments No comments

  2. LucyChen-MSFT 1,045 Reputation points Microsoft Vendor
    2024-04-01T06:30:41.1733333+00:00

    Hi @Xanakone SYPHANTHONG,

    Thanks for your information. I am glad to hear that you've solved your issue. However, I still suggest completing a full database consistency check to ensure you don't have consistency errors and your data is good. DBCC CHECKDB (Transact-SQL) - SQL Server | Microsoft Learn.

    Best regards,

    Lucy Chen


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our Documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    https://docs.microsoft.com/en-us/answers/support/email-notifications

    0 comments No comments