question

Vaidyanathan-5630 avatar image
0 Votes"
Vaidyanathan-5630 asked FanFan-MSFT commented

I've list of mssql named instance in a text file. I want to read one by one in DOS batch file and replace \ with -

I've list of mssql named instance in a text file. I want to read one by one in DOS batch file and replace \ with -.

Intention : I need to connect to list of mssql instances given in a text file, and run a certain query given in sql file. And want to store the output in the csv file by naming it with respective mssql instance name.

Problem: My scripts works well as long as it is default instance i.e. named instance has \ special character in it, so could not create a csv file like HostName\instance name.csv

Ask: Is there any command in DOS bat file to replace \ with any character/letter such as - or _ or any alphabet letter?

windows-10-general
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Sorry that the scripts are not supported int the Q&A now.
If there are anyone who is familiar with that, welcome to share the experience.

Best Regards,

0 Votes 0 ·

0 Answers