--查看当前的存放位置
select database_id,name,physical_name AS CurrentLocation,state_desc,size from sys.master_files
where database_id=db_id(N'数据库名');
--修改文件的存放位置下次启动生效
--xtDb为数据库名,
alter database 数据库名 modify file ( name = 逻辑文件名(不包含后缀), filename = '文件变更后存储路径');
alter database 数据库名 modify file ( name = 逻辑文件名(不包含后缀), filename = '文件变更后存储路径');
alter database xtDb modify file ( name = xtDb, filename = 'G:SQLDATAxtDbxtDb.mdf');
alter database xtDb modify file ( name = xtDb_log, filename = 'G:SQLDATAxtDbxtdb_log.ldf');