This website uses cookies. By clicking Accept, you consent to the use of cookies. Click Here to learn more about how we use cookies.
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
- Revenera Community
- :
- InstallShield
- :
- InstallShield Forum
- :
- SQL Text Replacement Question
Subscribe
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jun 26, 2017
04:08 PM
SQL Text Replacement Question
Suppose I have literal brackets ([&]) in my SQL script. How do I do text replacement?
For example... suppose I have the line
BACKUP DATABASE [MyDatabaseName]
How would I do text replacement using the property YOUR_DATABASE_NAME?
Thanks.
For example... suppose I have the line
BACKUP DATABASE [MyDatabaseName]
How would I do text replacement using the property YOUR_DATABASE_NAME?
Thanks.
(2) Replies
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jun 27, 2017
10:10 AM
I always make the SQL Script so it has a chance of running outside of the installer still.
So I would take a default database name and use that in the script like
BACKUP DATABASE DCP_PROD
Then in the text replacement just do
DCP_PROD -> [YOUR_DATABASE_NAME]
Actually, I use
DCP_PROD -> [IS_SQLSERVER_DATABASE]
More often so I can capture the name of the catalog/database they typed into the UISequence and substitute that in the text replacement.
Chad
So I would take a default database name and use that in the script like
BACKUP DATABASE DCP_PROD
Then in the text replacement just do
DCP_PROD -> [YOUR_DATABASE_NAME]
Actually, I use
DCP_PROD -> [IS_SQLSERVER_DATABASE]
More often so I can capture the name of the catalog/database they typed into the UISequence and substitute that in the text replacement.
Chad
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jun 27, 2017
11:11 AM
Thanks Chad. Another way to resolve is to just remove the [] as long as spaces are not allowed in the database name.
![](/skins/images/D60DF682EA37BF37032955CE10F3F0BB/responsive_peak/images/icon_anonymous_message.png)