문제

i want to append a line of text to a text file in SQLCMD The line of text is 'Have a nice day' i have following command prompt.

SQLCMD -STest -Usa -PPassword1 -i" have a nice day" >> c:\log.txt

도움이 되었습니까?

해결책

The solution is to create a batch file (.bat) with your SQLCMD command followed by a ECHO command and run this file.

The contents of the file should be something like this:

SQLCMD -STest -Usa -PPassword1 >> C:\log.txt

ECHO "Have a nice day!" >> C:\log.txt

You can also try to play with @ECHO ON or @ECHO OFF at the beginning of the file depending if you run the .bat file from Command Prompt.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top