https://www.cnblogs.com/xwdreamer/archive/2012/06/23/2559344.html

--查询端口号
exec sys.sp_readerrorlog 0, 1, 'listening'