If you are one those who likes to work with command prompt. Then this article will help you to get started.
Method 1 :
Open the command prompt (OR) press CTRL+R and type CMD it will open the command prompt.
Once you opened the command prompt type SQLCMD. If you have default instance it will open the SQLCMD utility to work with SQLServer otherwise, you will get an error.
Method 2 :
Now you can use
In the above command -S(Capital Letter) to specify the Server name and Instance name , -E is the default option to login with the windows authentication.
If you want to run as the SQL Server authentication. then, you can use the below command
Once you specified the -U, you are not supposed to use windows credentials. this option is those who want to work with SQL Server Logins
Use GO with after every command you type in Command Prompt.
To know the SQL Version you are running.
To know the SQL Server name and Instance name.
To know about the databases