来自sys.master_files的特殊报告...数据库错误 [英] Peculiar report from sys.master_files ... the "name" of the database is wrong

查看:85
本文介绍了来自sys.master_files的特殊报告...数据库错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

很久以前,我使用ssmse2k8接口重命名了数据库.我通过在现有名称后附加"W"来反映系统上新驱动器的添加.

今天,一年半后,我跑了:

I renamed a database using the ssmse2k8 interface a long time ago. I was reflecting the addition of a new drive on the system by appending a "W" to the existing name.

Today, a year and a half later, I ran:

SELECT * FROM sys.master_files WHERE [type_desc] = ''ROWS''



然后数据库[name]作为附件前的名称返回,但没有"W"!

我尝试了重命名数据库的备份,尝试了数据库的DROP,并重新安装了数据库.尽管来自BACKUP的新.mdf和.ldf现在具有正确的名称,并带有"W",但查询结果仍然为我提供了旧名称.

我正在使用sys.master_files,因为我似乎找不到任何其他组方法来遍历此实例上的数据库.

而且我想解决问题,而不仅仅是在使用串联的[name]上加上"W".

谢谢



即使重新启动,[name]不仅不正确...
但是master_file的[physical_name]被报告为新名称.

[END EDIT]



And the database [name] came back as the pre-appendage name without the "W"!

I''ve tried backup of the renamed database, tried DROP of the database, and have REATTACHED the database. While the new .mdf and .ldf from the BACKUP now have the correct name with the appended "W", the query results still gives me the old name.

I''m using the sys.master_files because I can''t seem to find any other group method to iterate through the databases on this instance.

And I''d like to fix the problem not just tack a "W" onto the [name] I get using a concatenation.

Thanks



Not only is the [name] incorrect, even after restart ...
but the [physical_name] of the master_file is reported as the new name.

[END EDIT]

推荐答案

解决方案:

将"W"连接到[name]的末尾.
The solution:

Concatenation of "W" to the end of the [name].


这篇关于来自sys.master_files的特殊报告...数据库错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆