Code as follows:
Windows Server 2008 Standard Version 64-bit
SQL Server Standard Version 64-bit
Query user library data file default path:
DECLARE @DefaultData VARCHAR (100)
EXEC Master.. Xp_regread @rootkey = ' HKEY_LOCAL_MACHINE ',
@key = ' Softwaremicrosoftmicrosoft SQL servermssql.1mssqlserver ',
@value_name = ' Defaultdata ',
@DefaultData = @DefaultData OUTPUT
SELECT @DefaultData
Query user library log file default path:
DECLARE @DefaultLog VARCHAR (100)
EXEC Master.. Xp_regread @rootkey = ' HKEY_LOCAL_MACHINE ',
@key = ' Softwaremicrosoftmicrosoft SQL servermssql.1mssqlserver ',
@value_name = ' Defaultlog ',
@DefaultLog = @DefaultLog OUTPUT
SELECT @DefaultLog
Query user library backup file default path:
DECLARE @BackupDirectory VARCHAR (100)
EXEC Master.. Xp_regread @rootkey = ' HKEY_LOCAL_MACHINE ',
@key = ' Softwaremicrosoftmicrosoft SQL servermssql.1mssqlserver ',
@value_name = ' BackupDirectory ',
@BackupDirectory = @BackupDirectory OUTPUT
SELECT @BackupDirectory
To modify the user library data file default path:
EXEC Master.. Xp_regwrite
@rootkey = ' HKEY_LOCAL_MACHINE ',
@key = ' Softwaremicrosoftmicrosoft SQL servermssql.1mssqlserver ',
@value_name = ' Defaultdata ',
@type = ' REG_SZ ',
@value = ' D:sql2005data '
Modify User library log file default path:
EXEC Master.. Xp_regwrite
@rootkey = ' HKEY_LOCAL_MACHINE ',
@key = ' Softwaremicrosoftmicrosoft SQL servermssql.1mssqlserver ',
@value_name = ' Defaultlog ',
@type = ' REG_SZ ',
@value = ' D:sql2005log '
To modify the default path for user library backup files:
EXEC Master.. Xp_regwrite
@rootkey = ' HKEY_LOCAL_MACHINE ',
@key = ' Softwaremicrosoftmicrosoft SQL servermssql.1mssqlserver ',
@value_name = ' BackupDirectory ',
@type = ' REG_SZ ',
@value = ' D:sql2005dbbak '
Copy code code as follows:
Windows Server 2008 Standard Version 64-bit
SQL Server 2008 Standard Version 64-bit
Query user library data file default path:
DECLARE @DefaultData VARCHAR (100)
EXEC Master.. Xp_regread @rootkey = ' HKEY_LOCAL_MACHINE ',
@key = ' Softwaremicrosoftmicrosoft SQL servermssql10.sql2008mssqlserver ',
@value_name = ' Defaultdata ',
@DefaultData = @DefaultData OUTPUT
SELECT @DefaultData
Query user library log file default path:
DECLARE @DefaultLog VARCHAR (100)
EXEC Master.. Xp_regread @rootkey = ' HKEY_LOCAL_MACHINE ',
@key = ' Softwaremicrosoftmicrosoft SQL servermssql10.sql2008mssqlserver ',
@value_name = ' Defaultlog ',
@DefaultLog = @DefaultLog OUTPUT
SELECT @DefaultLog
Query user library backup file default path:
DECLARE @BackupDirectory VARCHAR (100)
EXEC Master.. Xp_regread @rootkey = ' HKEY_LOCAL_MACHINE ',
@key = ' Softwaremicrosoftmicrosoft SQL servermssql10.sql2008mssqlserver ',
@value_name = ' BackupDirectory ',
@BackupDirectory = @BackupDirectory OUTPUT
SELECT @BackupDirectory
To modify the user library data file default path:
EXEC Master.. Xp_regwrite
@rootkey = ' HKEY_LOCAL_MACHINE ',
@key = ' Softwaremicrosoftmicrosoft SQL servermssql10.sql2008mssqlserver ',
@value_name = ' Defaultdata ',
@type = ' REG_SZ ',
@value = ' D:sql2008data '
Modify User library log file default path:
EXEC Master.. Xp_regwrite
@rootkey = ' HKEY_LOCAL_MACHINE ',
@key = ' Softwaremicrosoftmicrosoft SQL servermssql10.sql2008mssqlserver ',
@value_name = ' Defaultlog ',
@type = ' REG_SZ ',
@value = ' D:sql2008log '
Modify the default path for user library backup files:
EXEC master. Xp_regwrite
@rootkey = ' HKEY_LOCAL_MACHINE ',
@key = ' Softwaremicrosoftmicrosoft SQL Servermssql10.sql2008mssqlserver ',
@value_name = ' BackupDirectory ',
@type = ' REG_SZ ',
@value = ' D: Sql2008dbbak '