I want to construct the query used with the OPENROWSET method.
Example:
SELECT *
FROM
OPENROWSET
('SQLOLEDB', 'srv'; 'login'; 'mdp';
'SELECT *
FROM Case
WHERE ID = ' + @caseID)
But when I do that I get the error: Incorrect Syntax near '+'
How can I build the query? Thank