Differences between sfsql and SnowSQL

SnowSQL (snowsql) provides many improvements and enhancements over the sfsql command-line interface, including more intuitive option and command names. This topic lists differences in usage between the two command-line clients.

Command-line options

Many of the command-line options in SnowSQL are backward-compatible with the corresponding options in sfsql; however, there are key differences, as described in the following table:

OptionsfsqlSnowSQL (snowsql)
Account identifier-a-a , --accountname
User name-u-u , --username
Password-cN/A (use SNOWSQL_PWD environment variable)
Prompt for passwordN/A-P
Database-d-d , --dbname
Schema-s-s , --schemaname
Warehouse-w-w , --warehouse
Role-r-r , --rolename
Host name-g-h , --host
Port number-p-p , --port
MFA passcode-m-m , --mfa-passcode
MFA passcode in password-n--mfa-passcode-in-password
Explain a SQL-e (not supported)N/A
Explain a SQL in dot form-x (not supported)N/A
Run a SQL file-f-f , --filename
Stop on errorN/A-o stop_on_error=true
Exit on error-k-o exit_on_error=true
Authenticator-b--authenticator
Use a user-defined connectionN/A-c , --connection
Trace level-t-o log_level=(INFO|DEBUG)
Show CLI versionN/A-v , --version
Use specified configN/A--config
Set optionsN/A-o , --option
Set variablesN/A-D , --variable
Help-h-? , --help

Commands

For commands, the key difference is all commands in SnowSQL must be prefixed with an exclamation point (e.g. !exit). In addition, the names of some of the commands have changed.

CommandsfsqlSnowSQL (snowsql)
Load and run a SQL fileload , @!source , !load
Print a messageecho!print
Set an optionN/A!set
Show all optionsN/A!options
Set a variableset-var!define
Unset a variableunset-varN/A
Show all variablesN/A!variables
Connect and start a new sessionconnect!connect
Exit the current sessionN/A!exit , !disconnect (see also !quit)
Spool output into a filespool!spool
Quit the CLIexit , quit!quit
Executes a system commandsystem!system
Helphelp!help

Special characters

The following characters have special meaning in the two clients:

UsagesfsqlSnowSQL (snowsql)
Prefix for variable names$&&
Setting off comments in code#-- and /* ... */