Failure to execute 'executeQuery', SQL State HY000, Error Code 0, You must specify a Client Id to retrieve data.. code example
Example 1: GET AROUND MAXIMIN PREFIX FOR RPC OUT ON LINKED SERVER
DECLARE @name sysname,
@sql nvarchar(MAX)
SELECT @sql =
'DECLARE cur CURSOR STATIC LOCAL FOR
SELECT TOP (5) CompanyName FROM dbo.Customers
ORDER BY CustomerID'
EXEC sp_executesql @sql
OPEN cur
Example 2: GET AROUND MAXIMIN PREFIX FOR RPC OUT ON LINKED SERVER
DECLARE cur CURSOR STATIC LOCAL FOR
SELECT ...