以示例数据库NorthWind为例 在sql窗口中执行一下语句
EXEC sp_attach_db @dbname = 'NorthWind',
@filename1 = 'C:UsershupengyangDesktop
orthwnd
orthwnd.mdf', --mdf文件路径
@filename2 = 'C:UsershupengyangDesktop
orthwnd
orthwnd.ldf' --ldf文件路径
以示例数据库NorthWind为例 在sql窗口中执行一下语句
EXEC sp_attach_db @dbname = 'NorthWind',
@filename1 = 'C:UsershupengyangDesktop
orthwnd
orthwnd.mdf', --mdf文件路径
@filename2 = 'C:UsershupengyangDesktop
orthwnd
orthwnd.ldf' --ldf文件路径