导入mdf文件和ldf文件到数据库是网站搬家或者是初学者学习源码是必要的一步,接下来为大家详细介绍实现sql语句,感兴趣的你可不要错过了哈希望可以帮助到你
代码如下:
USE master;
Go
EXEC sp_attach_db @dbname = N'数据库名',
@filename1 = N'完整目录的mdf文件',
@filename2 = N'完整目录的ldf文件';
GO
如
USE master;
Go
EXEC sp_attach_db @dbname = N'db_shop', //db_shop是数据库名字
@filename1 = N'E:\TM\07\Database\db_shop_Data.MDF',
@filename2 = N'E:\TM\07\Database\db_shop_Log.LDF';
GO
Statement: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