Is there any way to declare a variable inside an OPENQUERY statement (querying MySQL db). I only want to declare a variable inside the actual statement. So I don't need to pass a variable into the statement (I know this isn't possible).
Is it possible to declare a variable inside the openquery statement?
SELECT *
FROM OPENQUERY([SERVER], '
SET @s = 1;
SELECT
@s
'
)
This returns the error
Cannot process the object. The OLE DB provider **** for linked server ***** indicates that either the object has no columns or the current user does not have permissions on that object.