echo a % to a file

  • Thread starter Thread starter Jay
  • Start date Start date
J

Jay

Hi

I need to create a batch file that creates a sql script that includes a %
symbol in the sql code, like:

echo and dev_addr like "\\" + @source_app_server + "\%" > .\gsys.sql

but the % gets dropped and I get

and dev_addr like "\\" + @source_app_server + "\"

I've also tried
echo and dev_addr like "\\" + @source_app_server + "\^%" > .\gsys.sql

but I get
and dev_addr like "\\" + @source_app_server + "\^"

Can anybody tell me how I do this?

Thanks in advance.

Jay
 
Jay said:
Hi

I need to create a batch file that creates a sql script that includes a %
symbol in the sql code, like:

echo and dev_addr like "\\" + @source_app_server + "\%" > .\gsys.sql

but the % gets dropped and I get

and dev_addr like "\\" + @source_app_server + "\"

I've also tried
echo and dev_addr like "\\" + @source_app_server + "\^%" > .\gsys.sql

but I get
and dev_addr like "\\" + @source_app_server + "\^"

Can anybody tell me how I do this?

If you are doing this in a batch file, you need to use two % symbols. Ex:

echo and dev_addr like "\\" + @source_app_server + "\%%" > .\gsys.sql
--
Tom Porterfield
MS-MVP Windows
http://support.teloep.org

Please post all follow-ups to the newsgroup only.
 
Thanks Tom. That does the job.

Jay


Tom Porterfield said:
If you are doing this in a batch file, you need to use two % symbols. Ex:

echo and dev_addr like "\\" + @source_app_server + "\%%" > .\gsys.sql
--
Tom Porterfield
MS-MVP Windows
http://support.teloep.org

Please post all follow-ups to the newsgroup only.
 
Back
Top