Hi @sns,
I tested it according to the documentation you provided, and it works as described in the documentation without any problems.
The error reported in your screenshot should be that there is a problem with the .UDL file you created, please check the following steps:
1.Create a new empty Text Document
2.Save As Test.UDL and Select All files in Save as type.
3.Double-click Test.UDL to open the file for testing.
In addition, you can also check SQL Server Connectivity from SharePoint via powershell , please refer to:
https://www.sharepointdiary.com/2014/08/how-to-check-sql-server-connectivity-from-sharepoint.html
(New-Object System.Net.Sockets.TCPClient("SQL-Server-Name",1433)).Connected
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.