复制代码 代码如下:
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
原创文章,作者:奋斗,如若转载,请注明出处:https://blog.ytso.com/tech/database/236274.html