Báo lỗi ở sql server long path name files năm 2024

Hãy nâng cấp lên Microsoft Edge để tận dụng các tính năng mới nhất, bản cập nhật bảo mật và hỗ trợ kỹ thuật.

LOCALDB_ERROR_INSTANCE_FOLDER_PATH_TOO_LONG

  • Bài viết
  • 02/28/2023

Trong bài viết này

Applies to:

Details

Attribute Value Product Name SQL Server Event ID 260 Event Source SQL Server Local Database Runtime 12.0 Component Local Database Runtime API Message Text The full path length of the Local Database instance folder is longer than MAX_PATH. The instance must be stored in folder: %%LOCALAPPDATA%%\Microsoft\Microsoft SQL Server Local DB\Instances\.

Explanation

The path where the instance should be stored is longer than MAX_PATH.

User Action

Create a new path that is shorter than MAX_PATH.


Phản hồi

Trang này có hữu ích không?

Phản hồi

Sắp ra mắt: Trong năm 2024, chúng tôi sẽ dần gỡ bỏ Sự cố với GitHub dưới dạng cơ chế phản hồi cho nội dung và thay thế bằng hệ thống phản hồi mới. Để biết thêm thông tin, hãy xem: https://aka.ms/ContentUserFeedback.

Gửi và xem ý kiến phản hồi dành cho

Tài nguyên bổ sung

Trong bài viết này

Hãy nâng cấp lên Microsoft Edge để tận dụng các tính năng mới nhất, bản cập nhật bảo mật và hỗ trợ kỹ thuật.

MSSQLSERVER_5009

  • Bài viết
  • 05/11/2023

Trong bài viết này

Applies to:

Details

Attribute Value Product Name SQL Server Event ID 5009 Event Source MSSQLSERVER Component SQLEngine Symbolic Name ALT_BADDISKS Message Text One or more files listed in the statement could not be found or could not be initialized

Explanation

This error indicates that you specified a file name or fileID in ALTER DATABASE or DBCC SHRINK* command that could not be resolved.

Consider the following scenario:

  • You have a Microsoft SQL Server database that uses a full or bulk-logged recovery model.
  • You add a new data file that is named db_file1 to the database.
  • You set the file type for the db_file1 file as data.
  • You realize that you specified the file type incorrectly.
  • You remove the db_file1 file, and then you back up the transaction log for this database.
  • You add a new log file that is named db_file1 to the same database.
  • You try to remove the log file that is named db_file1 by using the ALTER DATABASE statement or by using SQL Server Management Studio.

In this scenario, you receive an error message that resembles the following:

Msg 5009, Level 16, State 9, Line 1 One or more files listed in the statement could not be found or could not be initialized.

Possible causes

This issue occurs if the logical name of the file that you try to remove is not unique in the system catalog tables. For example, this issue occurs if the file existed in the database earlier, and then the file was removed.

When you try to remove a file that has the same logical name, SQL Server tries to remove the dropped logical file. This results in the error message.

User action

To work around this issue, follow these steps.

Note

These steps cause the file ID values to be reused.

Use the ALTER DATABASE statement to remove the logical file that you created in step 1, as in the following example:

One of my students downloaded SQL Server 2014 Express Edition media and placed it on the desktop of his computer. Then he proceeded to run SQL Server setup from there. On the Global Rules page of SQL Server setup, the following rule failed and he was not able to continue SQL Server installation:

Global Rules Long path names to files on SQL Server installation media (failed).

Báo lỗi ở sql server long path name files năm 2024

Cause

This rule fails when SQL Server installation media is located on a long network path or a long local path (on the computer) composed of many subdirectories or directories that have long names, and this long path is not supported by SQL Server setup program.

Solution

Reduce the length of the path or make the path shorter.

I suggested the student to copy the folder on his Windows desktop where the SQL Server media was located to the root of the C drive and install from there. After he copied the media, the media was located at C:\SQLMedia folder. The student was then able to install SQL Server successfully.