Log on to the remote SQL2005 port 1434 using Query Analyzer and SQLCMD separately

Source: Internet
Author: User

Sqlcmd is a command-line tool for manipulating SQL Server, and Query Analyzer is its graphical tool
      Query Analyzer (SQL2005 called Managerment Studio) , connected to the remote SQLSERVER2005, if it is 1433 port, using the default instance name, Telnet time directly in the server name input box to enter the destination IP address can be easily done.
      If the SQL2005 on a server is not using 1433 ports, but 1434 ports, the connection will not be directly input IP,
This time we need to enter:
Ip\ < instance name >,< port number;
Less one is not connected (I test under SQLSERVER2005, I do not know the future version will not be so troublesome), such as I want to connect the IP address is: 192.168.1.55, the instance name is SQL2005, The port number is 1434 SQLSERVER2005 server, then I need to enter in the Server name field:  ,
192.168.1.55\sql2005,1434
above is to use the graphics tool to connect SQLSERVER2005, Below we say the command line under the connection SQLSERVER2005 server
SQLSERVER2005 command line tool under the name is SQLCMD (the command line tool for sqlserver2000 is osql),
Its connection format is:
SQLCMD -u user name-p password-S IP address <
If the port number is omitted, the default connection is 1433 port
It has a slightly different connection method and Query Analyzer, assuming that the password for the SQL2005 server SA on 192.168.1.55 is SA, The port is 1434
We can connect like this
sqlcmd-u sa-p sa-s 192.168.1.55,1434
If you connect port 1433, you can omit the port: sqlcmd-u sa-p sa-s 192.168.1.55 (also note that-u,-p,-s must be uppercase Oh, there is a comma between the IP address and the port number)
If you want to know other ways to use it, you can enter
SQLCMD/?
in the command line. The more useful parameters that I personally think are the-I (Execute SQL file)-d (select database)  

Use Query Analyzer and sqlcmd to log on to the remote SQL2005 1434 port separately

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.