The osql tool is a Microsoft Windows 32 command Prompt tool that you can use to run Transact-SQL statements and script files. The osql tool communicates with the server using the ODBC database application programming Interface (API).
This article mainly introduces using the CMD Command Line window under Windows to operate SQL Server, first we can run osql?/, so that all the commands that can operate SQL Server through the cmd command line are displayed. osql Download Address http://www.jb51.net/database/57662.html
(There is a picture of the truth)
Then we know that the Connect server is-s, login ID is-u, password is-p
Let's try the operation now.
Run Osql-s "Database Server"-U "login username"-P "Login Password"
A 1> indicates a successful connection, at which point you can enter the SQL statement to operate.
CMD command line to operate Sqlserver,dotnetgeek feel not much useful, and, select out of the data typesetting display is not neat and beautiful,
You can use this method if you are on a computer that does not have SQL Server and you just want to manipulate the company's SQL Server.