如何修改SQL Server 2005/2008 数据库路径
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='SoftwareMicrosoftMicrosoft SQL ServerMSSQL.1MSSQLServer',
@value_name='DefaultData',
@DefaultData=@DefaultData OUTPUT
SELECT @DefaultData
查询用户库Log文件默认路径:
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
查询用户库备份文件默认路径:
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
修改用户库Data文件默认路径:
EXEC master..xp_regwrite
@rootkey='HKEY_LOCAL_MACHINE',
@key='SoftwareMicrosoftMicrosoft SQL ServerMSSQL.1MSSQLServer',
@value_name='DefaultData',
@type='REG_SZ',
@value='D:SQL2005Data'
修改用户库Log文件默认路径:
EXEC master..xp_regwrite
@rootkey='HKEY_LOCAL_MACHINE',
@key='SoftwareMicrosoftMicrosoft SQL ServerMSSQL.1MSSQLServer',
@value_name='DefaultLog',
@type='REG_SZ',
@value='D:SQL2005Log'
修改用户库备份文件默认路径:
EXEC master..xp_regwrite
@rootkey='HKEY_LOCAL_MACHINE',
@key='SoftwareMicrosoftMicrosoft SQL ServerMSSQL.1MSSQLServer',
@value_name='BackupDirectory',
@type='REG_SZ',
@value='D:SQL2005DBBak'
复制代码 代码如下:
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='SoftwareMicrosoftMicrosoft SQL ServerMSSQL10.SQL2008MSSQLServer',
@value_name='DefaultData',
@DefaultData=@DefaultData OUTPUT
SELECT @DefaultData
查询用户库Log文件默认路径:
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
查询用户库备份文件默认路径:
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
修改用户库Data文件默认路径:
EXEC master..xp_regwrite
@rootkey='HKEY_LOCAL_MACHINE',
@key='SoftwareMicrosoftMicrosoft SQL ServerMSSQL10.SQL2008MSSQLServer',
@value_name='DefaultData',
@type='REG_SZ',
@value='D:SQL2008Data'
修改用户库Log文件默认路径:
EXEC master..xp_regwrite
@rootkey='HKEY_LOCAL_MACHINE',
@key='SoftwareMicrosoftMicrosoft SQL ServerMSSQL10.SQL2008MSSQLServer',
@value_name='DefaultLog',
@type='REG_SZ',
@value='D:SQL2008Log'
修改用户库备份文件默认路径:
EXEC master..xp_regwrite
@rootkey='HKEY_LOCAL_MACHINE',
@key='SoftwareMicrosoftMicrosoft SQL ServerMSSQL10.SQL2008MSSQLServer',
@value_name='BackupDirectory',
@type='REG_SZ',
@value='D:SQL2008DBBak'
上一篇: 极具发展前景的3款PHP框架
推荐阅读
-
SQL Server 2005/2008用户数据库文件默认路径和默认备份路径修改方法
-
如何在SQL Server 2005数据库中导入SQL Server 2008的数据
-
解决SQL SERVER 2008数据库表中修改字段后不能保存
-
SQL Server2005、2008如何彻底删除卸载并重新安装?
-
SQL Server 2000/2005/2008删除或压缩数据库日志的方法
-
详解SQL Server如何修改数据库物理文件的存在位置
-
SQL Server 2008数据库误删数据如何进行数据恢复
-
如何创建和还原SQL Server 2005数据库?
-
修改SQL Server 2005/2008 用户数据库文件默认路径和默认备份路
-
如何修改SQL Server 2005/2008 数据库路径