1.查看当前的存放路径:
select database_id,name,physical_name AS
CurrentLocation,state_desc,size from sys.master_files
where
database_id=db_id(N'ComDataCenter');
database_id=db_id(N'ComDataCenter');
2.修改存放路径,这里的数据库为:ComDataCenter
alter database ComDataCenter modify file ( name = ComDataCenter,
filename =
'G:\SQL_SERVER_DATA\comdatacenter');
alter database ComDataCenter modify file ( name =
ComDataCenter_log, filename =
'G:\SQL_SERVER_DATA\comdatacenter');
3.重启数据库即可。