How can we help you today? How can we help you today?

File locations during a restore

When I do a restore and get to the screen to select the Database to restore to I always have to change the location for the files. If I pick an existing database is does not show that databases location and if I pick a new one it does not pick up the default for the instance of SQL. Am I missing something?
Giggles220
0

Comments

6 comments

  • petey
    When you run the following, are the right values returned?
    DECLARE @data nvarchar(256)
    DECLARE @log nvarchar(256)
    EXEC master..sqbutility 1012, @data OUTPUT, @log OUTPUT
    SELECT @data, @log
    
    Thanks.
    petey
    0
  • Giggles220
    When I run the query I get my default path, but when I try to do a restore from a file I get a different path. I have screenshots if it helps.

    [/img]
    Giggles220
    0
  • petey
    Thanks for bringing this to our attention. I have raised an internal report for this (ref. SB-3429).
    petey
    0
  • bbrown
    I am also seeing this problem. I am trying to restore a 4.6 backup using 5.2. When I get to the Choose Database dialog box, I do not see any of the data files, nor does the ... box function.
    bbrown
    0
  • Toeho
    Is there an update on this as I am havingthe same issue - version 5.3
    Toeho
    0
  • Brian Donahue
    If you are restoring through the user interface, SQL Backup tries to work out the default data location for the instance of SQL Server you're restoring to. This is always going to be the same unless you change the registry on the SQL Server computer. Here are the relevant entries:
    For SQL Server 2000:
    HKEY_LOCAL_MACHINE\Software\Microsoft\MSSQLServer\MSSQLServer\DefaultData
    /* if this isn't set, then... */
    HKEY_LOCAL_MACHINE\Software\Microsoft\MSSQLServer\Setup\SQLDataRoot + '\Data'
    
    For SQL Server 2005:
    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\<instancename>\Setup\DefaultData
    /* if this isn't set, then...*/
    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\<instancename>\SQLDataRoot + '\Data'
    

    So setting the DefaultData registry key to the location where you want the database files created will change the location selected by the SQL Backup console. If the log location is different than the default data location, I can't see how you have any other choice than to manually pick the log file directory when you restore.
    Brian Donahue
    0

Add comment

Please sign in to leave a comment.