sql-input-ring-file-name

sql-input-ring-file-name is a variable defined in `sql.el'.
Its value is
nil


Documentation:
If non-nil, name of the file to read/write input history.

You have to set this variable if you want the history of your commands
saved from one Emacs session to the next. If this variable is set,
exiting the SQL interpreter in an SQLi buffer will write the input
history to the specified file. Starting a new process in a SQLi buffer
will read the input history from the specified file.

This is used to initialize `comint-input-ring-file-name'.

Note that the size of the input history is determined by the variable
`comint-input-ring-size'.

You can customize this variable.