Hi,@kkran
Welcome to Microsoft T-SQL Q&A Forum!
Maybe you have seen the official documentation, OPENQUERY will not accept variables, maybe you can use a temporary table, extract data from the table into local variables,
or use dynamic queries, which are also written in the sql series of books, please refer to Link.
For the link between the progress database and the current sql, please refer to this document.
Best regards,
Bert Zhou
If the answer is the right solution, 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.