A Microsoft extension to the ANSI SQL language that includes procedural programming, local variables, and various support functions.
Hi @Ludmil G
Please check this:
DECLARE @Test1 NVARCHAR(10);
SET @Test1 = '111';
SELECT *
FROM Test1 t1
JOIN OPENQUERY(TestServer, 'SELECT * FROM T2 WHERE Column1 = ''' + @Test1 + ''' and Column2 != ''''')t2 ON t1.Column3 = t2.Column3
Best regards,
LiHong
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.