When you say "SQL file" do you mean a text file containing T-SQL statments? If so, execute OSQL from the command prompt with the /i option.
osql /S servername /d dbname /U username /P password /i mysqlfile.sql
mysqlfile.sql is the file containing the T-SQL statements.
I'm not clear what you mean by "save the command in buffer to a file." You can type the OSQL command line in a text editor and save a BAT file to be executed later. If that's not what you need to know, please provide a little more detail. Terry L. Broadbent
faq183-874 contains some tips and ideas for posting questions in these forums. Please review it and comment if you have time.
NOTE: Reference to the FAQ is part of my signature and is not directed at any individual.