IMPROVE RESTORE DATABASE TSQL (inline script) - Advanced Installer Community
meysam
Posts: 31
Joined: Fri Feb 27, 2015 11:23 am

IMPROVE RESTORE DATABASE TSQL (inline script)

i want restore backup database and my scenario is:

1- create regular folder in public document called "db"
2- add file database.bak file to this folder
3- create inline script with this TSQL:

Code: Select all

  use master
				RESTORE DATABASE VNLite 
				FROM DISK = 'C:\Users\Public\Documents\db\database.bak'
				WITH 
						MOVE N'database_data' TO N'd:\datadb\database.mdf',  
						MOVE N'database_log' TO N'd:\datadb\database_1.ldf',
				replace
with 3 step everything is work and correct but i think this TSQL can be improve in line "FROM DISK = C:\..."

my question is how change path to use [SourceDir] property not public document?
i want change this path but can't edit tsql ?
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: IMPROVE RESTORE DATABASE TSQL (inline script)

Hello,

To achieve what you want you can use our "SQL Script Replacement" feature.

If you have any questions let us know.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
meysam
Posts: 31
Joined: Fri Feb 27, 2015 11:23 am

Re: IMPROVE RESTORE DATABASE TSQL (inline script)

thank you so much Daniel

it's work. Like ;)
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: IMPROVE RESTORE DATABASE TSQL (inline script)

You're welcome.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”