cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Waterdog66
Level 3

SQL Text Replacement not Working at All

I am trying to get the Text Subsitutions working with SQL Scripts and nothing is working. First I tried using 'TextSubSetValue' to define a global that I set from script and used in the SQL Text Substitution. (No Luck)

Then I tried just entering static text into the "Replace With" and still no luck. I know that my search string is correct because I can paste it into the search window in the Script tab and if finds it. (Still No Luck)

Anyone else able to get this to work?

I am running IS2010 Pro under Windows 7.
Labels (1)
0 Kudos
(6) Replies
hidenori
Level 17

Did you check out this thread?
0 Kudos
Waterdog66
Level 3

hidenori wrote:
Did you check out this thread?


Yes, I did. I am sure am using the Angle Brackets in the substitution. I tried factoring the complexity away and just used fixed strings for replacement with no luck.

I am using InstallScript (No MSI) so this seems to be the correct way to go. (Using the String Replacement Feature)
0 Kudos
hidenori
Level 17

Can you try a new InstallScript project with a very simple SQL script like this?

CREATE DATABASE %DBNAME%
GO

Add the following SQL Text Replacement, and see if the Hello database is created on the target server.

Find What: %DBNAME%
Replace With: Hello
0 Kudos
Waterdog66
Level 3

hidenori wrote:
Can you try a new InstallScript project with a very simple SQL script like this?

CREATE DATABASE %DBNAME%
GO

Add the following SQL Text Replacement, and see if the Hello database is created on the target server.

Find What: %DBNAME%
Replace With: Hello


Thanks, for the reply and it appears to be working now. (Your sample worked also)

I time crunched at the moment but it seems that the substitutions started working when I set my SQL Scripts to execute in Batch Mode. (They were installing with the DB Component before) I don't have dependencies between my scripts so Batch Mode did not seem necessary. (Until now)

I will try some more stuff out later and try to diagnose and will update the thread with what I find.
0 Kudos
operaza
Level 4

Hello,
Is there a way to use a variable in installscript projects so the text substitution happen based on a custom value set a run time?
Thanks

hidenori wrote:
Can you try a new InstallScript project with a very simple SQL script like this?

CREATE DATABASE %DBNAME%
GO

Add the following SQL Text Replacement, and see if the Hello database is created on the target server.

Find What: %DBNAME%
Replace With: Hello
0 Kudos
operaza
Level 4

operaza wrote:
Hello,
Is there a way to use a variable in installscript projects so the text substitution happen based on a custom value set a run time?
Thanks


I was missing the % %, it worked by using:
1- the %variable% in the script (sql script tab)
2- in the script text replacement tab find what: %variable%
replace with:
3- Calling the function TextSubSetValue ( "", "Now it Works", TRUE )
0 Kudos