CREATE DATABASE failed

由于环境需要, 故修改SQL Server 2012的默认的数据库的数据文件和日志文件的位置. 如下:

image

创建数据库, 遭遇报错.

image

错误信息:

A file activation error occurred. The physical file name 'E:testaaa.mdf' may be incorrect. Diagnose and correct additional errors, and retry the operation.
CREATE DATABASE failed. Some file names listed could not be created. Check related errors. (Microsoft SQL Server, Error: 5105)

 

观察错误信息, 发现汇报说我的文件名为'E:testaaa.mdf'. 很明显, 这里少了个backward slash.

手动添加一个backward slash, 无果.

用文本框边上的按钮, 选择根目录, 确定. 依然无果.

查了KB, 无果.

 

解决方法

====================

在根目录下创建了个文件夹, 默认位置都改为根目录的某个文件夹, OK了.

 

评论

====================

根目录让人家选, 又不让用, 真让人恼火.

 

参考资料

=======================

You may receive error messages when you use the CREATE DATABASE statement to create a SQL Server database

http://support.microsoft.com/kb/836873/en-us

原文地址:https://www.cnblogs.com/awpatp/p/3939529.html