# SQL Server Restore Database Action not expanding variables

**URL:** https://www.finalbuilder.com/forums/t/sql-server-restore-database-action-not-expanding-variables/4644
**Category:** Bugs
**Created:** [May 22, 2007, 3:49am UTC](https://www.finalbuilder.com/forums/t/sql-server-restore-database-action-not-expanding-variables/4644 "2007-05-22T03:49:21Z")
**Posts on this page:** 10
**Page:** 1

<div class="post-metadata">

### Author: ![dscheidt](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/d/e480ec/32.png) [@dscheidt](https://www.finalbuilder.com/forums/u/dscheidt)
#### Post date: [May 22, 2007, 3:49am UTC](https://www.finalbuilder.com/forums/t/sql-server-restore-database-action-not-expanding-variables/4644/1 "2007-05-22T03:49:21Z")

</div>

Hi,

When I put a variable in the Database/Restore from File box, the command just passes the variable to the code rather than expanding it.

Thanks,

- David Scheidt

---

<div class="post-metadata">

### Author: ![paulsamways](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/p/e8c25b/32.png) [@paulsamways](https://www.finalbuilder.com/forums/u/paulsamways)
#### Post date: [May 23, 2007, 1:20am UTC](https://www.finalbuilder.com/forums/t/sql-server-restore-database-action-not-expanding-variables/4644/2 "2007-05-23T01:20:36Z")

</div>

Hi David,  
  
Thanks for reporting this bug. I’ll let you know when the new test build is available.  
  
Regards,  
Paul.

---

<div class="post-metadata">

### Author: ![dscheidt](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/d/e480ec/32.png) [@dscheidt](https://www.finalbuilder.com/forums/u/dscheidt)
#### Post date: [May 23, 2007, 2:41am UTC](https://www.finalbuilder.com/forums/t/sql-server-restore-database-action-not-expanding-variables/4644/3 "2007-05-23T02:41:46Z")

</div>

Thanks Paul!  
  
One other tiny request… In the SQL Backup command, one cannot specify a file name. I’m trying to do a backup/restore from one database server to another, and it would be helpful to have the filename be ‘static’. I can get around that now by doing the file list into a variable, so it’s not critical.  
  
Thanks again!  
- David Scheidt

---

<div class="post-metadata">

### Author: ![paulsamways](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/p/e8c25b/32.png) [@paulsamways](https://www.finalbuilder.com/forums/u/paulsamways)
#### Post date: [May 24, 2007, 2:41am UTC](https://www.finalbuilder.com/forums/t/sql-server-restore-database-action-not-expanding-variables/4644/4 "2007-05-24T02:41:39Z")

</div>

Hi David,  
  
The new build should be available soon.  
  
In regards to the output filename, the tool which the action uses (SqlMaint - [http://msdn2.microsoft.com/en-us/library/ms162827.aspx](http://msdn2.microsoft.com/en-us/library/ms162827.aspx)) does not support specifying the filename, only the path. Your current work-around would be the best method to get the filename of the file, you could also use a date/time filter on the fileset to only include files which were created after the action had started, which would guarantee only the new backup file was included.  
  
Regards,  
Paul.

---

<div class="post-metadata">

### Author: ![dscheidt](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/d/e480ec/32.png) [@dscheidt](https://www.finalbuilder.com/forums/u/dscheidt)
#### Post date: [May 24, 2007, 2:52am UTC](https://www.finalbuilder.com/forums/t/sql-server-restore-database-action-not-expanding-variables/4644/5 "2007-05-24T02:52:43Z")

</div>

Wow! That was FAST! When you said ‘soon’, I was thinking near the end of the week, not 2 hours later!  
  
Thanks guys! I’ll give it a try. And, I’ll try the timestamp solution too.  
  
Thanks again,  
- David Scheidt

---

<div class="post-metadata">

### Author: ![dscheidt](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/d/e480ec/32.png) [@dscheidt](https://www.finalbuilder.com/forums/u/dscheidt)
#### Post date: [May 24, 2007, 3:13am UTC](https://www.finalbuilder.com/forums/t/sql-server-restore-database-action-not-expanding-variables/4644/6 "2007-05-24T03:13:16Z")

</div>

Paul,  
The parameter expansion works, but… When I try to do a restore, I get a timeout error after 30 seconds! The backup works fine, BTW.  
  
Thanks again!  
- David Scheidt

---

<div class="post-metadata">

### Author: ![paulsamways](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/p/e8c25b/32.png) [@paulsamways](https://www.finalbuilder.com/forums/u/paulsamways)
#### Post date: [May 28, 2007, 2:59am UTC](https://www.finalbuilder.com/forums/t/sql-server-restore-database-action-not-expanding-variables/4644/7 "2007-05-28T02:59:00Z")

</div>

Hi David,  
  
Have you tried checking “Set Database to Single User Mode while Restoring” on the Database tab of the action properties? Does this resolve the timeout?   
  
If not does the log contain any additional information about the timeout?  
  
Regards,  
Paul.

---

<div class="post-metadata">

### Author: ![dscheidt](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/d/e480ec/32.png) [@dscheidt](https://www.finalbuilder.com/forums/u/dscheidt)
#### Post date: [May 30, 2007, 3:54am UTC](https://www.finalbuilder.com/forums/t/sql-server-restore-database-action-not-expanding-variables/4644/8 "2007-05-30T03:54:56Z")

</div>

Hi Paul,   
 Unfortunately, setting the ‘Set Database to Single User Mode while Restoring’ did not help. The exact error from the log that I am getting is:   
  
 Could not restore backup: Timeout expired   
  
 If you guys are using a SQL command to run the restore, you might be getting a timeout on the connection.   
  
 Hope that helps!   
 - David Scheidt

---

<div class="post-metadata">

### Author: ![paulsamways](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/p/e8c25b/32.png) [@paulsamways](https://www.finalbuilder.com/forums/u/paulsamways)
#### Post date: [May 31, 2007, 6:30am UTC](https://www.finalbuilder.com/forums/t/sql-server-restore-database-action-not-expanding-variables/4644/9 "2007-05-31T06:30:11Z")

</div>

Hi David,   
  
 I’ve increased the timeout on the connection in the latest test build.   
  
 Download: [http://www.automise.com/downloads/automise/200/AT200\_91.exe](http://www.automise.com/downloads/automise/200/AT200_91.exe)   
  
 Regards,   
 Paul.

---

<div class="post-metadata">

### Author: ![dscheidt](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/d/e480ec/32.png) [@dscheidt](https://www.finalbuilder.com/forums/u/dscheidt)
#### Post date: [May 31, 2007, 4:14am UTC](https://www.finalbuilder.com/forums/t/sql-server-restore-database-action-not-expanding-variables/4644/10 "2007-05-31T04:14:31Z")

</div>

Paul,

That worked!&nbsp; Thanks for the fast response!

Thanks again,

- David Scheidt
