After you have set up your linked server, you can use Database.executeSql function, which is a part of the standard Virtual Ticket APIs for database access, to retrieve the data:
Since the database access API is accessible only from server-side MetaScript – either from a server-side Form script or from a Scheduled Task script – the simplest way to test & debug your script is to create a test form that allows you to call server-side function(s) on demand and displays the returned data.
Test form example
Create Server-Side MetaScript on your test form and rearrange the code:
Then put new button on the test form and write the following code in the Click Action: