Original source: http://blog.csdn.net/dba_huangzj/article/details/38489765, featured catalogue:http://blog.csdn.net/dba_huangzj/article/details/37906349
No person shall, without the consent of the author, be published in the form of "original" or used for commercial purposes, and I am not responsible for any legal liability.
Previous article: http://blog.csdn.net/dba_huangzj/article/details/38438363
Objective:
SQL Server Endpoint (Endpoint) is a portal to and from SQL Server, with endpoints, anything that can be transferred between the network and SQL Server. The endpoint can be either system-or user-defined, where the system endpoint allows SQL Server to connect using T-mail and send a query.
The endpoint uses a specific protocol definition, which can be HTTP or TCP, starting with SQL Server 2012, the HTTP endpoint is removed from the built-in Web Services feature, and only the TCP endpoint can be used.
Custom endpoints are typically used for the purpose of:
- TCP requests. This article describes this and can be used to establish a private or secure SQL Server connection.
- Service Broker
- Database Mirroring
Realize:
1. Enter the following statement in the query window:
CREATE ENDPOINT Mytsqlendpoint state = started as TCP ( listener_port = 8080, listener_ip = (127.0.0.1) ) for TSQL ();
2. After execution, you will receive a message like this, which means that all logins through the default T-SQL endpoint connection will lose all permissions, and you need to use the following statement to authorize:
GRANT CONNECT on Endpoint::[tsql Default TCP] to [public];
News:
Creating a TSQL endpoint will cause all the ' public ' connection permissions on the ' TSQL Default TCP ' endpoint to be revoked. If ' Public ' access is required on this endpoint, reapply this permission using ' GRANT CONNECT on Endpoint::[tsql Default TCP ' to [public].
3. You can use the following statement to query the endpoint condition:
SELECT * from sys.tcp_endpoints;
4. You can start or stop the endpoint using the ALTER ENDPOINT command:
ALTER ENDPOINT [TSQL Default TCP] state = STOPPED;
Principle:
When SQL Server installation is complete, the corresponding SQL Server system endpoint is created for each network protocol. Permissions to access the endpoint are assigned to the public server role. Each SQL Server login has the public role permission and can be authorized and recycled through the following statement:
REVOKE CONNECT on Endpoint::[tsql Default TCP] to [public]; GRANT CONNECT on Endpoint::[tsql Default TCP] to [a_specific_login];