2013-04-21 17:04:07
數(shù)據(jù)庫(kù)默認(rèn)路徑保存在注冊(cè)表里,我們可以通過(guò)xp_instance_regwrite來(lái)修改注冊(cè)表,具體可以試試下面的方法:
--1.更改資料文件默認(rèn)存放路經(jīng):
EXEC xp_instance_regwrite
@rootkey='HKEY_LOCAL_MACHINE',
@key='Software\Microsoft\MSSQLServer\MSSQLServer',
@value_name='DefaultData',
@type=REG_SZ,
@value='D:\MSSQL\Data'
--2.更改日志文件默認(rèn)存放路經(jīng):
EXEC master..xp_instance_regwrite
@rootkey='HKEY_LOCAL_MACHINE',
@key='Software\Microsoft\MSSQLServer\MSSQLServer',
@value_name='DefaultLog',
@type=REG_SZ,
@value='D:\MSSQL\Data'