如何重命名物理数据库文件
- 作者: 我是要成为海贼老王的男人
- 来源: 51数据库
- 2022-10-20
问题描述
我已经使用 tsql 来分离这样的数据库:
I have used tsql to detach a database like this:
EXEC sp_detach_db @dbname = 'my_db'
然后我使用 PHP 来重命名物理文件.我能够重命名 mdf 文件,但不能重命名 ldf 文件!我什至尝试了一个 dos 命令 REN 但这对 ldf 文件也不起作用!
I then made use of PHP to rename the physical files. I was able to rename the mdf file but not the ldf file! I even tried a dos command REN but that didn't work for the ldf file either!
我想问一下,物理日志文件有什么特别的地方不允许重命名吗?
I wanted to ask, is there something special about the physical log files that allow it not to be renamed?
有没有更好的方法来做到这一点?
Is there a better way of doing this?
谢谢大家
推荐答案
分离数据库,重命名文件,重新附加.
Detach the Database, Rename the files, Attach it again.
推荐阅读
热点文章
检查拆分键盘
0
带有“上一个"的工具栏和“下一个"用于键盘输入AccessoryView
0
Activity 启动时显示软键盘
0
UIWebView 键盘 - 摆脱“上一个/下一个/完成"酒吧
0
在 iOS7 中边缘滑动时,使键盘与 UIView 同步动画
0
我的 iOS 应用程序中的键盘在 iPhone 6 上太高了.如何在 XCode 中调整键盘的分辨率?
0
android:inputType="textEmailAddress";- '@' 键和 '.com' 键?
0
禁用 iPhone 中键盘的方向
0
Android 2.3 模拟器上的印地语键盘问题
0
keyDown 没有被调用
0
