Changing listener IP on default TCP endpoint via DDL statement I'm running SQL server instances that are listening on all available interfaces (0.0.0.0). I need them to listen on one specific IP only. I also need to automate this configuration change, e.g. via a DDL statement. 

My strategy is to use ALTER ENDPOINT to change LISTENER_IP on the default TDS endpoint. 

I ran SELECT * FROM sys.endpoints and discovered the TSQL Default TCP endpoint. 

Then I executed the following SQL command: 

ALTER ENDPOINT "TSQL Default TCP"
AS TCP (
    LISTENER_IP = 192.168.4.22
)


This produced the following error.

Msg 7871, Level 15, State 1, Line 1
The clause 'AS TCP' is not valid for this endpoint type. 


This doesn't make sense to me. It is definitely a TCP endpoint.
The clause 'AS TCP' is not valid for this endpoint type.


This is because you are trying to alter a deafult endpoint, and the only options you can change for this are STATE and AUTHORIZATION:
Network Protocols and TDS Endpoints



So you can only stop this endpoint and create other endpoints.