Maison  >  Article  >  base de données  >  修改sqlserver2008默认的数据库文件保存路径

修改sqlserver2008默认的数据库文件保存路径

WBOY
WBOYoriginal
2016-06-07 15:54:011683parcourir

在配置工具中,右键服务器,然后选择属性。 然后数据库设置,再配置数据库默认位置 方法二,直接使用sql语句修改 USE [ master ] GO EXEC xp_instance_regwrite N HKEY_LOCAL_MACHINE , N Software\Microsoft\MSSQLServer\MSSQLServer , N DefaultData , REG

在配置工具中,右键服务器,然后选择属性。

然后数据库设置,再配置数据库默认位置

 

方法二,直接使用sql语句修改

<code style="margin: 0px; padding: 0px;"><span class="kwd" style="margin: 0px; padding: 0px;">USE<span class="pln" style="margin: 0px; padding: 0px;"> <span class="pun" style="margin: 0px; padding: 0px;">[<span class="pln" style="margin: 0px; padding: 0px;">master<span class="pun" style="margin: 0px; padding: 0px;">]<span class="pln" style="margin: 0px; padding: 0px;">
GO
<span class="kwd" style="margin: 0px; padding: 0px;">EXEC<span class="pln" style="margin: 0px; padding: 0px;"> xp_instance_regwrite N<span class="str" style="margin: 0px; padding: 0px;">&#39;HKEY_LOCAL_MACHINE&#39;<span class="pun" style="margin: 0px; padding: 0px;">,<span class="pln" style="margin: 0px; padding: 0px;"> N<span class="str" style="margin: 0px; padding: 0px;">&#39;Software\Microsoft\MSSQLServer\MSSQLServer&#39;<span class="pun" style="margin: 0px; padding: 0px;">,<span class="pln" style="margin: 0px; padding: 0px;"> N<span class="str" style="margin: 0px; padding: 0px;">&#39;DefaultData&#39;<span class="pun" style="margin: 0px; padding: 0px;">,<span class="pln" style="margin: 0px; padding: 0px;"> REG_SZ<span class="pun" style="margin: 0px; padding: 0px;">,<span class="pln" style="margin: 0px; padding: 0px;"> N<span class="str" style="margin: 0px; padding: 0px;">&#39;E:\YourData&#39;<span class="pln" style="margin: 0px; padding: 0px;">
GO
<span class="kwd" style="margin: 0px; padding: 0px;">EXEC<span class="pln" style="margin: 0px; padding: 0px;"> xp_instance_regwrite N<span class="str" style="margin: 0px; padding: 0px;">&#39;HKEY_LOCAL_MACHINE&#39;<span class="pun" style="margin: 0px; padding: 0px;">,<span class="pln" style="margin: 0px; padding: 0px;"> N<span class="str" style="margin: 0px; padding: 0px;">&#39;Software\Microsoft\MSSQLServer\MSSQLServer&#39;<span class="pun" style="margin: 0px; padding: 0px;">,<span class="pln" style="margin: 0px; padding: 0px;"> N<span class="str" style="margin: 0px; padding: 0px;">&#39;DefaultLog&#39;<span class="pun" style="margin: 0px; padding: 0px;">,<span class="pln" style="margin: 0px; padding: 0px;"> REG_SZ<span class="pun" style="margin: 0px; padding: 0px;">,<span class="pln" style="margin: 0px; padding: 0px;"> N<span class="str" style="margin: 0px; padding: 0px;">&#39;E:\YourLogs&#39;<span class="pln" style="margin: 0px; padding: 0px;">
GO </span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></code>
Déclaration:
Le contenu de cet article est volontairement contribué par les internautes et les droits d'auteur appartiennent à l'auteur original. Ce site n'assume aucune responsabilité légale correspondante. Si vous trouvez un contenu suspecté de plagiat ou de contrefaçon, veuillez contacter admin@php.cn