Search This Blog

Command for Start SQLCMD

To get started with SQLCMD, go to the command prompt and type SQLCMD. The basic switch for working with SQLCMD is -S, which identifies the server.

To provide an instance, the command would be:

sqlcmd -S ComputerName\InstanceName.

The authentication type has three switches:

-E is the default and uses the local user.

-U lets you specify a user, such as SA.

-P is the password. Passwords are case-sensitive. If the -P option is not used, and the SQLCMDPASSWORD environment variable has not been set, SQLCMD prompts the user for a password. If the -P option is used at the end of the command prompt without a password, SQLCMD uses the default password (NULL).