SQL Server’s oSQL – How to Create a Date-Stamped Log Use oSQL to run a query and save the output to a file that includes the date in the filename.