sqlcmd -S {ServerName}[SqlInstance] -i C:BackupsBoardScript.sql -o C:BackupsBoardFiles(DateTimeStampHERE).txt
I am running a Batch File to grab data from a database and put it into a simple TXT File. We may run this batch several times a week before we bring all the data together, but I do not want to overwrite the existing file, I would like to append a datetime stamp to the end of the file name. What’s the best way to do that?