SQL Server 2005/2008 用戶數據庫文件默許途徑和默許備份途徑修正辦法。本站提示廣大學習愛好者:(SQL Server 2005/2008 用戶數據庫文件默許途徑和默許備份途徑修正辦法)文章只能為提供參考,不一定能成為您想要的結果。以下是SQL Server 2005/2008 用戶數據庫文件默許途徑和默許備份途徑修正辦法正文
以下僅為參照,假如有多個實例,能夠會有些許分歧:
本情況是SQL Server 2005 Standard Version 64-bit 和 SQL Server 2008 Standard Version 64-bit 雙實例同時裝置在一個
Windows Server 2008 Standard Version 64-bit OS上:
代碼
Windows Server 2008 Standard Version 64-bit
SQL Server 2005 Standard Version 64-bit
查詢用戶庫Data文件默許途徑:
DECLARE @DefaultData VARCHAR(100)
EXEC master..xp_regread @rootkey='HKEY_LOCAL_MACHINE',
@key='Software\Microsoft\Microsoft SQL Server\MSSQL.1\MSSQLServer',
@value_name='DefaultData',
@DefaultData=@DefaultData OUTPUT
SELECT @DefaultData
查詢用戶庫Log文件默許途徑:
DECLARE @DefaultLog VARCHAR(100)
EXEC master..xp_regread @rootkey='HKEY_LOCAL_MACHINE',
@key='Software\Microsoft\Microsoft SQL Server\MSSQL.1\MSSQLServer',
@value_name='DefaultLog',
@DefaultLog=@DefaultLog OUTPUT
SELECT @DefaultLog
查詢用戶庫備份文件默許途徑:
DECLARE @BackupDirectory VARCHAR(100)
EXEC master..xp_regread @rootkey='HKEY_LOCAL_MACHINE',
@key='Software\Microsoft\Microsoft SQL Server\MSSQL.1\MSSQLServer',
@value_name='BackupDirectory',
@BackupDirectory=@BackupDirectory OUTPUT
SELECT @BackupDirectory
修正用戶庫Data文件默許途徑:
EXEC master..xp_regwrite
@rootkey='HKEY_LOCAL_MACHINE',
@key='Software\Microsoft\Microsoft SQL Server\MSSQL.1\MSSQLServer',
@value_name='DefaultData',
@type='REG_SZ',
@value='D:\SQL2005\Data'
修正用戶庫Log文件默許途徑:
EXEC master..xp_regwrite
@rootkey='HKEY_LOCAL_MACHINE',
@key='Software\Microsoft\Microsoft SQL Server\MSSQL.1\MSSQLServer',
@value_name='DefaultLog',
@type='REG_SZ',
@value='D:\SQL2005\Log'
修正用戶庫備份文件默許途徑:
EXEC master..xp_regwrite
@rootkey='HKEY_LOCAL_MACHINE',
@key='Software\Microsoft\Microsoft SQL Server\MSSQL.1\MSSQLServer',
@value_name='BackupDirectory',
@type='REG_SZ',
@value='D:\SQL2005\DBBak'
Windows Server 2008 Standard Version 64-bit
SQL Server 2008 Standard Version 64-bit
查詢用戶庫Data文件默許途徑:
DECLARE @DefaultData VARCHAR(100)
EXEC master..xp_regread @rootkey='HKEY_LOCAL_MACHINE',
@key='Software\Microsoft\Microsoft SQL Server\MSSQL10.SQL2008\MSSQLServer',
@value_name='DefaultData',
@DefaultData=@DefaultData OUTPUT
SELECT @DefaultData
查詢用戶庫Log文件默許途徑:
DECLARE @DefaultLog VARCHAR(100)
EXEC master..xp_regread @rootkey='HKEY_LOCAL_MACHINE',
@key='Software\Microsoft\Microsoft SQL Server\MSSQL10.SQL2008\MSSQLServer',
@value_name='DefaultLog',
@DefaultLog=@DefaultLog OUTPUT
SELECT @DefaultLog
查詢用戶庫備份文件默許途徑:
DECLARE @BackupDirectory VARCHAR(100)
EXEC master..xp_regread @rootkey='HKEY_LOCAL_MACHINE',
@key='Software\Microsoft\Microsoft SQL Server\MSSQL10.SQL2008\MSSQLServer',
@value_name='BackupDirectory',
@BackupDirectory=@BackupDirectory OUTPUT
SELECT @BackupDirectory
修正用戶庫Data文件默許途徑:
EXEC master..xp_regwrite
@rootkey='HKEY_LOCAL_MACHINE',
@key='Software\Microsoft\Microsoft SQL Server\MSSQL10.SQL2008\MSSQLServer',
@value_name='DefaultData',
@type='REG_SZ',
@value='D:\SQL2008\Data'
修正用戶庫Log文件默許途徑:
EXEC master..xp_regwrite
@rootkey='HKEY_LOCAL_MACHINE',
@key='Software\Microsoft\Microsoft SQL Server\MSSQL10.SQL2008\MSSQLServer',
@value_name='DefaultLog',
@type='REG_SZ',
@value='D:\SQL2008\Log'
修正用戶庫備份文件默許途徑:
EXEC master..xp_regwrite
@rootkey='HKEY_LOCAL_MACHINE',
@key='Software\Microsoft\Microsoft SQL Server\MSSQL10.SQL2008\MSSQLServer',
@value_name='BackupDirectory',
@type='REG_SZ',
@value='D:\SQL2008\DBBak'