时间:2021-07-01 10:21:17 帮助过:49人阅读
1.在数据库中新建查询,NewFile是数据库名称(可更改),.mdf,.ldf放在对应得C:\Program Files\Microsoft SQL Server\MSSQL11.MSSQLSERVER\MSSQL\DATA对应得数据文件下,执行脚本即可
USE master;
GO
CREATE DATABASE NewFile
ON (FILENAME = ‘C:\Program Files\Microsoft SQL Server\MSSQL11.MSSQLSERVER\MSSQL\DATA\db_NetShop.mdf‘),
(FILENAME = ‘C:\Program Files\Microsoft SQL Server\MSSQL11.MSSQLSERVER\MSSQL\DATA\db_NetShop_log.ldf‘)
FOR ATTACH;
GO
执行脚本附加sqlserver数据库.mdf 、.ldf
标签:新建 serve microsoft create 更改 sqlserver 查询 new ase