Home > Database > Mysql Tutorial > mssql server .ldf和.mdf的文件附加数据库的sql语句

mssql server .ldf和.mdf的文件附加数据库的sql语句

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-07 17:57:31
Original
1055 people have browsed it

mssql server .ldf和.mdf的文件附加数据库的sql语句

附加数据库就可以完成.

附加数据库:

企业管理器
--右键"数据库"
--所有任务
--附加数据库
--选择你的.mdf文件名
--确定
--如果提示没有.ldf文件,是否创建,选择"是"


查询分析器中的方法:
--有数据文件及日志文件的情况
sp_attach_db '数据库名'
,'数据文件名(*.mdf注意要带目录)' --后面可以是用,分隔的该数据库的多个数据文件
,'日志文件名(*.ldf注意要带目录)'--后面可以是用,分隔的该数据库的多个日志文件

--如果只有数据文件的情况
sp_attach_single_file_db '数据库名'
,'数据文件名(*.mdf注意要带目录)' --后面可以是用,分隔的该数据库的多个数据文件
Related labels:
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template